On 01/18/2018 05:17 PM, mimosinnet wrote:
The '?' is not necessary
Indeed!
I use `.*?` when I do not want the wild card to be
"greedy"
When I have a choice of using either, I always use
`.*?` so I remember the difference and as a kind
of comment that tells me not to be greedy.
Thank you!
>The '?' is not necessary ;-)
perl6 -e 'my $x="abcsdd1efg1234xyz"; $x ~~ m/(sd..).*(12..)/; say "$0, $1"'
sdd1, 1234
The "?" is to modify the "*" to be "non-greedy" - that is, it will match
the first chunk of stuff that is followed by whatever is after it (so,
"/*?/" the "?" is certainly unne
Thanks for this thread
El Tuesday, 16 de January del 2018 a les 19:28, Todd Chester va
escriure:
But I do have to use `.*?` in the middle when matching two things
$ perl6 -e 'my $x="abcsdd1efg1234xyz"; $x ~~ m/(sd..).*?(12..)/; say
"$0, $1"'
sdd1, 1234
The '?' is not necessary ;-)
perl6 -