Hello, i'm new to regex and been reading a lot of forum posts trying to figure out what i need to do with no luck. I'm sure this is so simple so apologies in advance!
I want to extract all words after several different identifiers in the data, so example data would be something like:
Supplier Shop XY Green Cat
Customer XY Blue Dog
Supplier AB Pink Snake
Wholesaler GH Black Frog
How can i use regex to parse all the text after XY, AB,GH ? I can do this individually by using XY +(.*) but how can i write it so that i can search on these multiple values?
Solved! Go to Solution.
Thanks @vishwa_0308 i just tried it but i get an error "an attempt to repeat something that cannot be repeated - for example a*+ at character 0"
these are the inputs on which i have tried the same expression
Supplier Shop XY Green Cat
Customer XY Blue Dog
Supplier AB Pink Snake
Wholesaler GH Black Frog
EF1234 Pluto ABC Planet six
EF2345 Mars ABC Chocolate flavour
F-Type Jaguar DEF Animal jungle
A-Type Mercedes A70 Car types 2
DF-Class Casserole MK2 Dinner time tonight
Regex Parse= .*\s\w{2}\s(.*)|.*\s[A-Z]\d{2}\s(.*)|.*\s\w{3}\s(.*)
Results:
Field1 | RegexOut1 | RegexOut2 | RegexOut3 |
Supplier Shop XY Green Cat | Green Cat | ||
Customer XY Blue Dog | Blue Dog | ||
Supplier AB Pink Snake | Pink Snake | ||
Wholesaler GH Black Frog | Black Frog | ||
EF1234 Pluto ABC Planet six | Planet six | ||
EF2345 Mars ABC Chocolate flavour | Chocolate flavour | ||
F-Type Jaguar DEF Animal jungle | Animal jungle | ||
A-Type Mercedes A70 Car types 2 | Car types 2 | ||
DF-Class Casserole MK2 Dinner time tonight | Dinner time tonight |
User | Count |
---|---|
18 | |
14 | |
13 | |
9 | |
8 |