If you want a single regex that matches either M123.5554 or 1234.435M, you need
to use the OR form (a|b):
([ML]\d+\.\d+|\d+\.\d+[ML])
where:
[ML] matches M or L
\d+ matches 1 or more digits
\. matches a .
-Fred
--
Science answers questions; philosophy questions answers.
On Jul 30, 2010, at 4:02 PM, Base wrote:
> Hi All -
>
> I am sure that this is an easy one, but I am stuck.
>
> I have a document that should have triplets of a letter (M or L)
> flllowed by 2 numbers. But the file has a ton of errors and often I
> find a number that would be
>
> M123.5554
> or 1234.435M
>
> i.e. - the letter gets appended to the end of the number.
>
> This seems like a great place to use regex....how would one craft a
> pattern for this?
>
> Thanks
>
> Base
>
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to [email protected]
> Note that posts from new members are moderated - please be patient with your
> first post.
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en