Hello, I am trying to use regex tool to get expected output from given "field1" values. Can you please someone help with regular expression to get expected output provided in "expected OP1" column.
| Field1 | expected OP1 |
| QDT1200M | T1200M |
| RX_9070XT | 9070XT |
| QDP400 | P400 |
| RTX4060TI | 4060TI |
| RTX4070TIS | 4070TIS |
| RTX4080S | 4080S |
| RX_9060XT | 9060XT |
| GFGTX1650 | 1650 |
| RTX3060TI-LHR | 3060TI-LHR |
What are the rules that define what you want to parse out? I don't see a clear pattern among the prefixes being removed from your sample data. (Specifically, the first and third cases where a single letter is kept, unless the 'Q' indicates to keep an extra letter?)
I agree with @CoG . Otherwise, you're going to need to build out a series of rules that account for each of the derivatives you're looking to remove. First pass would be parsing at the underscore ("_"), then you'd have to pull "QDT" and "QD" and "RTX" and "GFGTX" but as it stands there's no pattern yet to use REGEX against.
I think the easiest way is to use the Find and Replace tool to have a list of values you'd like to replace. In this case, you dont need a regex tool and you can get the same output
| Find Value | Replace Value |
| QD | Empty |
| RX_ | Empty |
| RTX | Empty |
| GFGTX | Empty |
Well done, @flying008
I didn't catch the pattern stemming from the right side of the string. Clever.
I am still curious, though, whether this REGEX you provided is going to work for the author's needs at scale (more values and potential variety). But it certainly addresses the specific examples that were provided.
Dear @jrlindem , hello!
IMHO, I suspect @sparkle's goal is to extract the graphics card model value from a string (minus the manufacturer and series prefix). Based on the current naming conventions of AMD and NVIDIA, the regular expression above should match most models, barring some specific ones. However, as long as @sparkle can clearly explain his needs (what he wants and what he doesn't want), a slight refinement of the regular expression should make it applicable to all scenarios.
@flying008 - Yes, I think you're absolutely right! Brilliant observations and explanation. And thanks for the responses. It's been a fun one to ponder and see how you've solved for it.
@sparkle if this solved it for you, be sure to mark flying008's response as the solution!
Cheers, -Jay
