List Info

Thread: Newbie Query




Newbie Query
user name
2006-03-02 20:49:10
Here's my regex:

(CM|cm)|(cm)\s\d{1,3}

and here's my target string:

Sub: CM292
Sub: cm400
Sub: XnJ cm 62

First of all, the query is only returning the CMs (upper and
lower
case), but not the digits.  Secondly, I have to believe
I've written
this extremely inefficiently.  Suggestions how to fix and
make more
efficient are greatly appreciated!

Thanks,
Dale


--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Newbie Query
user name
2006-03-02 22:41:08
u never told us WHAT u want to match - pls do it next time.
Judging
from you regex it's the sequence 'cm + some digits'. if
so then

cm\x20*\d{1,3}

with Ignorecase option ON should do it. \x20 is a white
space.


--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Newbie Query
user name
2006-03-03 19:38:43
Your regex matches the strings "CM" or
"cm" or "cm" followed by a
single space and a number with one to three digits. So your
sample data
will only match on the CM|cm part as there is no space
between cm and
the number I suggest

[cC][mM](\s*\d{1,3})?


--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Newbie Query
user name
2006-03-13 14:37:45
Thanks for all help!


--~--~---------~--~----~------------~-------~--~----~
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-4]

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