On Sun, Apr 24, 2011 at 5:42 PM, Tiago Hori <tiago.h...@gmail.com> wrote:
> Hi Brian and List > > > http://ideone.com/kk0OI > > I was studying the references about regular expression you pointed me to on > the link above and I just wanted make sure I understand properly. You used > the \Q just in case there is a metacharacter in one of the names that gets > stored in $_? Could that affect my search? Let's for example that on the > name that goes to $_ at one point I have something like [a-z] would the > regular expression there (/$_/) read that as a range of a to z if i didn't > use the \Q. > > Thanks! > > T. > Hey Tiago. That's exactly right. For example, see: http://ideone.com/YGq85 I'm not sure if it would affect your search. I dimly recall that FASTA files are just protein sequences, in which case it shouldn't really matter. "Just being paranoid, carry on" :P On the other hand, if you had something like, say, '3.4', then that dot would be a metacharacter unless you used \Q or quotemeta - So it would match 3.4, but also 344, or 3a4 and so on. My rule of thumb is that, if you didn't compile it using qr//, you probably want the quotemeta version. Brian.