Skip to content
Prev 157611 / 398506 Next

Pattern match in R

On 30-Sep-08 14:36:04, bioinformatics_guy wrote:
I think you want "Coverage_[1-9]*[0-9]$", since your form will
only
match "Coverage_mn" where m is one of 1-9 and n is one of 0-9.
The "*" means "zero or any number of ... ".

Example (command-line grep in Linux):

grep 'Coverage_[1-9]*[0-9]$' << EOT
Coverage_5
Coverage_19

Note that this does not catch "Coverage_01" because "[1-9]"
does not include "0". Use "[0-9]" here as well if you need this.

Hoping this helps,
Ted.


--------------------------------------------------------------------
E-Mail: (Ted Harding) <Ted.Harding at manchester.ac.uk>
Fax-to-email: +44 (0)870 094 0861
Date: 30-Sep-08                                       Time: 16:43:01
------------------------------ XFMail ------------------------------