in reply to Re^2: substituting capture groups substrings
in thread substituting capture groups substrings
For future browsers: /d should be \d, and really, unless you intend to allow unicode digits, should probably be [0-9].
Thats what //a and //aa are for (since v5.13.10 according to perlver)
$ perl -Mre=debug -le "print qr/\d/" Compiling REx "\d" Final program: 1: DIGIT (2) 2: END (0) stclass DIGIT minlen 1 (?^:\d) Freeing REx: "\d" $ perl -Mre=debug -le "print qr/\d/u" Compiling REx "\d" Final program: 1: DIGIT (2) 2: END (0) stclass DIGIT minlen 1 (?^u:\d) Freeing REx: "\d" $ perl -Mre=debug -le "print qr/\d/a" Compiling REx "\d" Final program: 1: DIGITA (2) 2: END (0) stclass DIGITA minlen 1 (?^a:\d) Freeing REx: "\d" $ perl -Mre=debug -le "print qr/\d/aa" Compiling REx "\d" Final program: 1: DIGITA (2) 2: END (0) stclass DIGITA minlen 1 (?^aa:\d) Freeing REx: "\d"
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: substituting capture groups substrings ( s///aa m//aa qr//aa)
by MidLifeXis (Monsignor) on Jul 15, 2015 at 11:52 UTC | |
by Anonymous Monk on Jul 15, 2015 at 23:28 UTC |