I've the following string:
My intention is to extract only 'test2'. Using
You can also use positive lookahead and lookbehind
My intention is to extract only 'test2'. Using \w*? as string match, I can get 'word2' as match, but I can't see a way of removing those underscores to match only 'word2'.
The underscores wont be part of the maching string, but will be before and after it
Going further, if the match string is on the beginning or end of the whole text, it wont be surrounded by underscores.
This one, makes optional the use of underscore in this specific situation.