Re: A Regular Expression Question

2014-06-11 Thread hohe72
You might check the matches with $ grep -nH --color=auto '' and then reuse the regex in sed. --hh "Martin G. McCormick" wrote (Tue, 10 Jun 2014 14:01:20 -0500): > I am trying to remove the & or ampersand sign from some perl > code I wrote as it is not necessary. I have no trouble finding > a

Re: A Regular Expression Question

2014-06-10 Thread Martin G. McCormick
Reco writes: > Try it like this: > > sed -r 's/&([a-z])/\1/g' It worked like a charm. I forgot about the parentheses and the \1 to limit the number of matches. My thanks to everyone who emailed me both on and off-list. Martin McCormick -- To UNSUBSCRIBE, email to debian-user-requ...@lists.d

Re: A Regular Expression Question

2014-06-10 Thread Reco
Hi. On Tue, 10 Jun 2014 14:01:20 -0500 "Martin G. McCormick" wrote: > The replacement pattern should actually be the same as the > search pattern except that it is missing the & or ampersand. Try it like this: sed -r 's/&([a-z])/\1/g' Or, in vim: s/&\([a-z]\)/\1/g Reco -- To UNSUBSCRIB

Re: A Regular Expression Question

2014-06-10 Thread Bzzzz
On Tue, 10 Jun 2014 14:01:20 -0500 "Martin G. McCormick" wrote: > I am trying to remove the & or ampersand sign from some perl > code I wrote as it is not necessary. I have no trouble finding > all the instances because they consist of an ampersand > immediately followed by a letter so &[a-z] des

A Regular Expression Question

2014-06-10 Thread Martin G. McCormick
I am trying to remove the & or ampersand sign from some perl code I wrote as it is not necessary. I have no trouble finding all the instances because they consist of an ampersand immediately followed by a letter so &[a-z] describes the case perfectly. The replacement pattern should actually be the