Hi, i'm trying to resolve a regex problem. I'm trying to use a backreference but don't know how. My documentation says I should use \1(or \l?)for that. Information on the internet says it should be g1,g2 etc. But neither seems to work. I have an example. I developed this regex to print all 3-letter words:
$tekst = "hoii hoi and oi"; while($tekst=~/\b(\w\w\w)\b/g){ print "$1\n"; }
I want to change it into all 3-letter words that occur more than once. So something like:
Maybe someone can tell me the proper way to do this. Thank you in advance./\b(\w\w\w)\b\g1/g)
In reply to regex backreference by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |