0

I am trying to capture records with specific terms followed by digits. I used both:

Select * from Table where Field Regexp 'Term [0-9]{1,6}'

and

Select * from Table where Field Regex 'Term [[:digit:]]'

However the issue is I grab ordinal #s like:

Term 33rd and Term 19th

which I don't want. I only want Term 33 and Term 19

I tried both:

Select * from Table where Field Regexp 'Term [0-9]{1,4}[^a-z]'

and

Select * from Table where Field Regex 'Term [[:digit:]][^a-z]'

Neither of which has any affect. Yet if I do

Select * from Table where Field Regex 'Term 33[^a-z]'

It will reject Term 33rd but find Term 33.

So it recognizes the [^a-z] negation when not using character class, leading me to believe there is some additional construction required to get the character-class and the regex negation to co-exist.

user3649739
  • 1,829
  • 2
  • 18
  • 28
  • Add $ sign for end of line : 'Term [0-9]{1,6}$' – Bernd Buffen Jun 23 '16 at 19:55
  • @BerndBuffen It isnt' the end of line that is breaking it not to mention the term can continue past the end of line. It works fine w/o $ w/o negation and works fine w/o $ using explicit digit and negation. So it is clearly some combination of character-class followed by negation. – user3649739 Jun 23 '16 at 20:08

0 Answers0