for several weeks im working with regular expressions in php. Now my question is: is there any way to make RegEx greedy for |?
For example, the topic: 012345abcdefghijklm
pattern: /(abcde|abcdefghi)/will fetch abcdethough abcdefghi- this is a greedier match.
The only way I found is to sort RegEx by the longest possible matches
thank
source
share