I have a log that includes a lot of paths along with other text. I want to get specific paths from the log without a trailing slash.
How to do it using regex?
For example, the text is:
some text /dir1/dir2/ some text
some text /dir1/dir3 some text
I'd like to get these matches:
/dir1/dir2
/dir1/dir3
I've tried different methods using positive lookahead, like:
\/dir1[^\s]*(?=\/)
But they didn't work. I would appreciate any support.