i have this :
dir1/
dir1/dir2/
dir1/dir2/dir1/
dir1/dir3/
dir1/dir3/dir1
dir2/dir1/
dir2/dir2/
dir3/
I want regex pattern that matches start with dir1/
and end with after first slash /
, result:
dir1/dir2/
dir1/dir3/
i have this :
dir1/
dir1/dir2/
dir1/dir2/dir1/
dir1/dir3/
dir1/dir3/dir1
dir2/dir1/
dir2/dir2/
dir3/
I want regex pattern that matches start with dir1/
and end with after first slash /
, result:
dir1/dir2/
dir1/dir3/
This is what you want:
^dir1\/[^\/]+\/?$
It matches with your desired strings:
dir1/dir2/
dir1/dir3/