This sets the regular expression to capture the string between the delimiters:
Test: This is a test string [more or less]
Regexp: (?<=\[)(.*?)(?=\])
Returns: more or less
What if the string to be captured also contains delimiters?
Test 1: This is a test string [more [or] less]
Refund 1: more [or] less
Test 2: This is a test string [more [or [and] or] less]
Refund 2: more [or [and] or] less
And a few brackets?
Test 3: This is a test string [more [or [and] or] less] and [less [or [and] or] more]
Refund 3: more [or [and] or] less , less [or [and] or] more
What regular expression will do this? Or what little ruby ββ/ python script can do this?
source share