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})[%])/;
In reply to Capture groups by legend
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |