Hi All,
I have the following string "stuff.my___1_year_on_practice". My Regular Expression looks like "((?:[^_]*){1})$". I am trying to Parse "practice" beginning at the end. The {1} means the last "_". Instead of "_" I want to do the last instance of any of: "abc_|def_|[0-9]_". So, for example, if my string is "stuff.my___1_year_2_practice_32", I want to match "practice_32". I think I almost have it but can someone help me get the last part working? Also, my expression creates two matches when I only want one.
Thank you so much!
Solved! Go to Solution.
Does - ".*_(\w+_\w+)$" work?
also - you want "practice" in your first example but "practice_32" in your second example?
Hi! Yes, I'm looking for "practice" in the first example and "practice_32" in the second example. So I'm looking for a way to stick something like (?:abc_|def_|[0-9]_) into the expression, with abc and def being specific strings and [0-9] as any digit. I also want to avoid two results being matched when doing this. Thanks for looking into this!
Hi! Just to clarify, "abc" and "def" are specific strings in my problem and the "32" in "practice_32" doesn't have to be a digit. Thanks for looking into this!
abc and def have a variety of possibilities - yes?
otherwise I'd use regex in parse mode with ".*_(abc_*\d*)$|.*_(abc_def)$" and then deal with the two columns later.