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

Re: Regex fun

by JavaFan (Canon)
on Dec 15, 2009 at 14:26 UTC ( [id://812877]=note: print w/replies, xml ) Need Help??


in reply to Regex fun

You cannot have a backreference as a quantifier. (Not that you have a capture group to reference to). If you want to do something like that, you may want to try:
s/\+([0-9]+)(??{ "[ACGTNacgtn]{$1}" })//g;

Replies are listed 'Best First'.
Re^2: Regex fun
by Hena (Friar) on Dec 15, 2009 at 14:43 UTC
    So it was as I feared.

    The code looks interesting. I suppose it's either this or what I posted earlier. I wonder if using (??{...}) hurts readability, though mine isn't much better I suppose.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (5)
As of 2024-06-25 09:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuli‥ 🛈The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.