On Dec 10, George Georgalis said:

>giving my perl a retry, I found some hints on a website to recursively
>replace text
>
>perl -p -i -e 's/old\(.\)atext/new\1btext/g;' $( find ./ -name '*.html' -o -name 
>'*.txt' )

This isn't recursively replacing text; it's recursively going through a
directory tree.

>but from what I can tell, perl doesn't support the \1 for \(*\) symbols
>like sed does.  What is the work around?

Because Perl is not sed.  Perl uses (...), not \(...\) for its memory
capturing.  In Perl's regexes, all non-alphanumeric metacharacters don't
use backslashes.  That means [...] for character classes, not \[...\], and
+ for " 1 or more", not \+, and so on.

-- 
Jeff "japhy" Pinyan      [EMAIL PROTECTED]      http://www.pobox.com/~japhy/
RPI Acacia brother #734   http://www.perlmonks.org/   http://www.cpan.org/
<stu> what does y/// stand for?  <tenderpuss> why, yansliterate of course.
[  I'm looking for programming work.  If you like my work, let me know.  ]


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to