Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

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?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (5)
As of 2015-07-28 03:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (251 votes), past polls