legend has asked for the wisdom of the Perl Monks concerning the following question:
I have some text like:
I want to capture the words and the number into two different strings like say:$text = "Grand Canyon 70%";
I was trying:$match[0] = "Grand Canyon"; $match[1] = "70%";
But I am getting a bunch of compilation errors complaining about the double tilde... Can someone help me out please?$text ~~ /([A-Za-z\s]*)([0-9]{1,2})[%])/;
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Capture groups
by brian_d_foy (Abbot) on Mar 05, 2008 at 00:51 UTC | |
Re: Capture groups
by Joost (Canon) on Mar 04, 2008 at 23:41 UTC | |
by wardy3 (Scribe) on Mar 04, 2008 at 23:57 UTC | |
by ww (Archbishop) on Mar 05, 2008 at 12:33 UTC | |
by doom (Deacon) on Mar 05, 2008 at 02:57 UTC | |
Re: Capture groups
by legend (Sexton) on Mar 05, 2008 at 00:23 UTC | |
by nefigah (Monk) on Mar 05, 2008 at 00:49 UTC | |
by ww (Archbishop) on Mar 05, 2008 at 12:46 UTC |
Back to
Seekers of Perl Wisdom