[Bioperl-l] A perl regex query
bix at sendu.me.uk
Tue Sep 18 08:53:34 EDT 2007
Spiros Denaxas wrote:
> Its not impossibe, you just have to use \b to denote the word boundaries :)
> echo 'this-is-a_test-D-string-D' | perl -ne ' s/\b\-D\-\b//g ; print ;'
> It only gets rid of -D- , all other occurrences of D and - remain intact.
I'm confused. The simpler:
echo 'this-is-a_test-D-string-D' | perl -ne ' s/-D-//g ; print ;'
gives the same answer. You'd have to something very strange for a regex
on -D- to match D or - alone.
More information about the Bioperl-l