I need to hack out an regular expression, which will match "SNPB" without
matching "STR SNPB".
Since ruby 1.8.2 or 1.8.4 don't support the lookbehind feature. what's the
workable regular expression
for ruby version 1.8.2?
I need to hack out an regular expression, which will match "SNPB" without
matching "STR SNPB".
Since ruby 1.8.2 or 1.8.4 don't support the lookbehind feature. what's the
workable regular expression
for ruby version 1.8.2?
On 1/17/06, Eric Luo <eric.wenbl@gmail.com> wrote:
I need to hack out an regular expression, which will match "SNPB" without
matching "STR SNPB".
Since ruby 1.8.2 or 1.8.4 don't support the lookbehind feature. what's the
workable regular expression
for ruby version 1.8.2?
To make the problem clear.
I want to only change the regular expression, but not the code to implement
this function.
Actually, the regular expression comes from a configurable table. I'll be
supposed to only have the privilege to update the table.
So What I really want is a alternative way to in place of the regular
expression
(?<!STR )SNPB
···
2006/1/17, James Edward Gray II <james@grayproductions.net>:
On Jan 16, 2006, at 8:35 PM, Eric Luo wrote:
> I need to hack out an regular expression, which will match "SNPB"
> without
> matching "STR SNPB".
> Since ruby 1.8.2 or 1.8.4 don't support the lookbehind feature.
> what's the
> workable regular expression
> for ruby version 1.8.2?
On 1/17/06, Eric Luo <eric.wenbl@gmail.com> wrote:
I need to hack out an regular expression, which will match "SNPB" without
matching "STR SNPB".
Since ruby 1.8.2 or 1.8.4 don't support the lookbehind feature. what's the
workable regular expression
for ruby version 1.8.2?
To make the problem clear.
I want to only change the regular expression, but not the code to implement
this function.
Actually, the regular expression comes from a configurable table. I'll be
supposed to only have the privilege to update the table.
So What I really want is a alternative way to in place of the regular
expression
(?<!STR )SNPB
--
strong and healthy, who thinks of sickness until it strikes like lightning?
preoccupied with the world, who thinks of death, until it arrives like
thunder? -- milarepa
> Thanks for your replay.
>
> To make the problem clear.
> I want to only change the regular expression, but not the code to
implement
> this function.
> Actually, the regular expression comes from a configurable table. I'll
be
> supposed to only have the privilege to update the table.
>
> So What I really want is a alternative way to in place of the regular
> expression
> (?<!STR )SNPB
-a
--
strong and healthy, who thinks of sickness until it strikes like
lightning?
preoccupied with the world, who thinks of death, until it arrives like
thunder? -- milarepa
> Thanks for your replay.
>
> To make the problem clear.
> I want to only change the regular expression, but not the code to
implement
> this function.
> Actually, the regular expression comes from a configurable table. I'll
be
> supposed to only have the privilege to update the table.
>
> So What I really want is a alternative way to in place of the regular
> expression
> (?<!STR )SNPB
-a
--
strong and healthy, who thinks of sickness until it strikes like
lightning?
preoccupied with the world, who thinks of death, until it arrives like
thunder? -- milarepa
But "STR bla SNPB " will also be matched, which is not expected.
--
strong and healthy, who thinks of sickness until it strikes like lightning?
preoccupied with the world, who thinks of death, until it arrives like
thunder? -- milarepa
and does not on any of my machines. are you seeing something different?
the way that regular expression reads is:
- beginning of line
- zero or more things that are either
- not an S
- an S followed by not a T
- or ST followed by not an R
- the string SNPB
(we ignore the remainder of the string, though you could do more here
if
needed)
so the appearance of the string STR __anywhere__ before a SNPB will cause
the
match to fail.
hth.
-a
--
strong and healthy, who thinks of sickness until it strikes like
lightning?
preoccupied with the world, who thinks of death, until it arrives like
thunder? -- milarepa