The text is like this:
$string = " <L UXUHSXUS>importantText</L>";
I would like to use the lookbehind feature in PHP Regular Expression
but it generates an error everytime I try to put .+ or any regular expression things
preg_match_all('%(?<=<L.+>)([\s\S]*?)(?=</LF>)%',$string, $matches);
this gives an error.
what should I do to add .+ or .* or any reserved regular expression things in lookbehind and lookahead?
Since you only use positive lookarounds you could probably replace all lookarounds with non-capturing groups
(?:)instead:Note that you might want to make the first search non-greedy: