in reply to Get chars between 2 markers using regular expressions
The following code is commented by virtue of the x modifier. Take a look at perlre for details.
my @matches = / He\d #Match 'He' followed by a single digit. (.+?) #Capture characters non-greedily ~~ #until the end marker is reached /gx; #The g modifier matches multiple instances #into the @matches list
|
|---|