Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re^3: \1, \2, \3, ... inside of a character class

by gmpassos (Priest)
on Aug 13, 2004 at 01:18 UTC ( [id://382524]=note: print w/replies, xml ) Need Help??


in reply to Re^2: \1, \2, \3, ... inside of a character class
in thread \1, \2, \3, ... inside of a character class

Ok, what you want is \1 working as a group of chars. Well, we can't, but you can use some complexer code:
$var = "abXaaabbbc" ; $var =~ s/(..)X(??{"[$1]+"})/${1}#/ ; print "$var\n" ;
Output:
ab#c

Graciliano M. P.
"Creativity is the expression of the liberty".

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://382524]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (5)
As of 2024-03-28 14:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found