Re: how to run regex calculation
Wesley Peng <[email protected]>
| Newsgroups | gmane.comp.apache.mod-perl |
|---|---|
| Message-ID | <[email protected]> |
Hallo on 2020/1/9 16:35, demerphq wrote: > $str=~/(\d+)\s(\d+)\s(\1*\2)/ > > $1 refers to the capture buffers from the last completed match, \1 > inside of the pattern part of a regex refers to the capture buffer of > the currently matching regex. This doesn't work too. perl -Mstrict -le 'my $str = "2 3 6"; print "true" if $str=~/(\d+)\s(\d+)\s(\1*\2)/' nothing printed. Regards.