I am looking to extract an id from a url/filepath
The path can be:
images/tJpwYL9baWgH56USKZwqTz7QM9g1_48x48.png or https://.../.../images/tJpwYL9baWgH56USKZwqTz7QM9g1_150x150.png
I would like to extract the unique ids (in this case tJpwYL9baWgH56USKZwqTz7QM9g1)
So far I came up with the following expression:
([^\/]+[_$])
This includes however the _ , so I get tJpwYL9baWgH56USKZwqTz7QM9g1_
How can I do this and exclude the _?