List Info

Thread: problems with RegExp




problems with RegExp
user name
2006-04-21 18:28:38
it's b/c u r misusing the container class [....]

look at the container [10]  : it means that 0 and 1 will
both be
matched by the engine in your string. That's whay u
validate 0 as true.

what are you trying to match with this regex? number s from
1 to 19?


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Regex" group.
To post to this group, send email to regexgooglegroups.com
To unsubscribe from this group, send email to
regex-unsubscribegooglegroups.com
For more options, visit this group at http://groups.go
ogle.com/group/regex
-~----------~----~----~----~------~----~------~--~---

problems with RegExp
user name
2006-04-21 18:47:38
"what are you trying to match with the regex?  numbers
from 1 to 19?"

Yes, BUT the numbers are actually index values in a database
table and
they are subject to change in the future.  New indexes may
be created
in the future and old ones deleted.  What's the right way
for listing
numbers with more than one digit?


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Regex" group.
To post to this group, send email to regexgooglegroups.com
To unsubscribe from this group, send email to
regex-unsubscribegooglegroups.com
For more options, visit this group at http://groups.go
ogle.com/group/regex
-~----------~----~----~----~------~----~------~--~---

problems with RegExp
user name
2006-04-21 19:24:35
u match a number with >=1 digit as

\d+


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Regex" group.
To post to this group, send email to regexgooglegroups.com
To unsubscribe from this group, send email to
regex-unsubscribegooglegroups.com
For more options, visit this group at http://groups.go
ogle.com/group/regex
-~----------~----~----~----~------~----~------~--~---

problems with RegExp
user name
2006-04-21 19:37:11
But, as I understand it, \d+ will match -any- digit >=1
I want to check to make sure that the value I'm checking
matches one of
the index values in the database.  I need something more
restrictive
than \d+


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Regex" group.
To post to this group, send email to regexgooglegroups.com
To unsubscribe from this group, send email to
regex-unsubscribegooglegroups.com
For more options, visit this group at http://groups.go
ogle.com/group/regex
-~----------~----~----~----~------~----~------~--~---

problems with RegExp
user name
2006-04-21 19:52:10
\d+

was in response to your Q: **What's the right way for
listing numbers
with more than one digit? **

>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>
yr 2nd Q: for that u would want to use MatchEvaluator
finction:
1.match a digit to be checked
2. pass it to MatchEvaluator(), which compares the value
with a
array(list) of the values from yr database and returns bool
flag (match
/no match) as a result

remember, that regex was born to match PATTERNS , not
VALUES.

alternatively, u'll have dynamically create an ugly regex
that would
list ALL possibilities: e.g.

^1$|^22$|^2006$

would match numbers: 1, 22, 2006


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Regex" group.
To post to this group, send email to regexgooglegroups.com
To unsubscribe from this group, send email to
regex-unsubscribegooglegroups.com
For more options, visit this group at http://groups.go
ogle.com/group/regex
-~----------~----~----~----~------~----~------~--~---

[1-5]

about | contact  Other archives ( Real Estate discussion Medical topics )