This is a really simple task, I have a string:
s/test/foo/bar
I want one group to contain s/test/ and the rest to be contained in another group:
group 1: s/test group 2: foo/bar
My expression is:
(/s/test/)([a-z]+/)
This will do half of the job but only captures 'foo' in group 2. How do I also capture 'bar'. I tried:
(/s/test/)([a-z]+/)*
But I'm mis-understanding something because that captures too much of the full string. I've created a demo here:
Make the / character part of the second group.
(\/s\/test\/)([a-z\/]+)
Now only characters [a-z] are matched.