in reply to Regular expression to match text between two tags (was: Help!! Regular Expressions)
There is no global on it so it will get the first one. If for some chance there was more than one that you wanted, I would go withmy ($thingy) = $_ =~ /:::(.*?):::/s;
I keep seeing people talk about the dot star issue, but the dot star issue is not as much an issue if you have qualifiers before and after that force it to match a specific location.my (@thingies) = $_ =~ /:::(.*?)(?=:::)/sg; # ?= allows for it to start at the ::: on the next time through
|
|---|