regexp to extract the last underscore and the following letter (last letter) from words
8 views (last 30 days)
Ioannis Vourvachakis on 15 Nov 2021
I want to use regexp in order to extract only the last underscore and the last letter from the words below.
But if I have the words 'apple_c' and 'apple_man_man_h'
and I use regexp(words,'\_\w','split'),
then I get as a result 'apple' for both words, but it is wrong for me, because I want to extract onlythe last underscore and thr last letter, as I said.
The desired result for me is 'apple' and ''apple_man_man'.
How should i modify the command to achieve this?