I have an expression like
test_abc_HelloWorld_there could be more here.
- In a regular expression, I want the first word before to begin with an underscore. So get
"test"
I tried [A-Za-z]{1,}_ , but that didn't work.
- Then I would like to get "abc" or something in between the first 2 underscores.
2 Separate regular expressions not combined
Any help is much appreciated!
Example:
for 1) the regular expression will match the word test for 2) the regular expression will match the word abc
therefore, any other match for any case would be wrong. As with if I replaced what I matched, then I would get something like the following:
for case 1) correspond to "test" and replace "test" with "Goat".
'Goat_abc_HelloWorld_there could be more here'
I don't need a replacement, I just want a word match.
Eket source share