I can’t figure out how to match a pattern between LAST / and the end of the line.
I have tons of:
/usr/etc/blabla:/etc/bbb
/usr/etc/blabla:/etc/bffb.gh
/usr/etc/blabla:/local/fffusr
/usr/etc/blabla:/bin/dfusrd
/usr/etc/var:/etc/aaaaaf.ju
For example i want to match “usr” only when it is in the bold part.
I’m using grep.
EDIT:
I’ve a small problem with this solution:
/([^/]+)$
It doesn’t match the pattern if it is immediately after the /, for example those:
/usr/etc/blabla:/bin/usrlala
/bin/bla/:/etc/usr
are not matched
FOUND IT: /([^/]*)$
It would be:
But maybe you must escape the slash (
/) depending on your language: