schnarff has asked for the wisdom of the Perl Monks concerning the following question:
I know that I can repeat that subpattern easily with reptition quantifiers, i.e./(\d\s+foo)/
and that I can force a repeat of what had been matched, even after intervening characters, like this:/(\d\s+foo){1,3}/
however, I don't know if it's possible to repeat the conditions imposed by the subpattern (i.e. have a second occurance of the subpattern without spelling it all the way out). Is there a way of taking, say,/(\d\s+foo)[^\r\n]*\1/
and representing the second, identical subpattern with some symbol/metacharacter? I know that, in terms of pure functionality, such a distinction would be irrelevant, but frankly the redundancy wounds my sense of Perl beauty, and thus I'd prefer a cleaner, nicer way to do this. :-)/(\d\s+foo)[^\r\n]*(\d\s+foo)/
|
|---|