Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine

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: (5)
As of 2015-01-25 10:23 GMT
Find Nodes?
    Voting Booth?

    My top resolution in 2015 is:

    Results (181 votes), past polls