I'm trying to get the string between two specific matches, for example two hashtags.
What I would like to achieve:
input:
some text in front ##hi there## some text behind
output:
hi there
With /%%(.*)%%/
, ##hi there##
is returned.
Thanks in advance
You need a look ahead and look behind.
(?<=##).*(?=##)
This will match hi there