I need help with a regular expression that will find matches in the strings below:
myDOG_test
myCAT_test
Basically, I want to return 'DOG' or 'CAT' from these paths.
Then I have similar strings (all start with 'my') that don't contain the underscore AFTER the value I want, and in that case I just want to return the FULL string -- in a match group.
myCentralReports
myDEMO3
This is the REGEXP that I have so far:
.*?my(.*?)\_.*
This correctly puts CAT & DOG in the matching group, but I'm having problems matching the other 2 strings. Obviously I left the hardcoded underscore in there just to show you what I started with -- but I need to modify this for the other case. Any help is appreciated! Thanks.