Page 1 of 1

Search for entries with a given field length?

Posted: Thu Sep 09, 2004 5:02 pm
by jkj2001
Hi,

We have a field in one of our tables that's either 10,11 or 12 characters long. We'd like to find those records where that value is exactly eleven characters, and unfortunately, we can't use the "length" function to do this on our web interface. Is there a way to pull it off with a rex expression, possibly using alnum?

For instance, our final query would look something like this:

select * from mytable where myfield like '/alnum{11,11}'


Thanks.

Search for entries with a given field length?

Posted: Thu Sep 09, 2004 5:18 pm
by mark
Exactly 11 of any character, anchored to field begin and end.
like '/>>=.{11}>>='
or
matches '???????????'
or (depending on your matchmode setting)
matches '___________'