Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?

Re: problems with backreference

by ikegami (Pope)
on Sep 06, 2011 at 15:33 UTC ( #924422=note: print w/ replies, xml ) Need Help??

in reply to problems with backreference

\1 is a regular expression pattern that matches what the first capture captured. It makes no sense to use it outside of regular expressions as you did.

Perl script:

s/^(ISA\~.*?\~.*?\~.*?\~.*?\~.*?\~.*?\~.*?\~)(..........)(....).(\~.*) +$/$1${2}0$3$4/

Perl command:

perl -i -pe's/^(ISA\~.*?\~.*?\~.*?\~.*?\~.*?\~.*?\~.*?\~)(..........)( +....).(\~.*)$/$1${2}0$3$4/' PB385930.P0

ssh command:

ssh ... 'perl -i -pe'\''s/^(ISA\~.*?\~.*?\~.*?\~.*?\~.*?\~.*?\~.*?\~)( +..........)(....).(\~.*)$/$1${2}0$3$4/'\'' PB385930.P0'

Note the ' needed to be escaped when placed inside another ' literal.

Comment on Re: problems with backreference
Select or Download Code

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (6)
As of 2015-12-02 00:50 GMT
Find Nodes?
    Voting Booth?

    My keyboard shows this many letters:

    Results (31 votes), past polls