in reply to Need to pull substring between two escape sequences.
That will probably not work the way you want it to on the following:my @matches = ($string =~ /!#(.*?)#!/g);
You probably wanted 678, but you get 45!#678 instead. Try something like the following:"123!#45!#678#!90"
See this node for details on this.my @matches = ($string =~ /!#((?:[^#!]|#(?!!))*)#!/g );
|
|---|