My input string is:
/234243/source_path/a/b/c.test
or something like:
/234243/source_path/a/b/c.test/check_w123
I want a regex to match substrings starting with source
and check
with the result like:
source
:source_path/a/b/c.test/
check
:check_w123
using a regex like /(?<source>source.*)(?<check>check.*)/
without ?
in the last group.
My regex is:
/(?<source>source.*)(?<check>check.*)?/
My Result is:
source
:source_path/a/b/c.test/check_w123
check
:nil