Matt,
Based on your first regex pattern, it looks like your number
always starts
with 3 digits, so you could use something like this to
isolate the shape:
\d(P(?:HU|H|R|D)?)
I am a little confused about the other items. In your
example 100PHX, which
character(s) represents the material and which represents
the metal? Thanks.
Rick
>
> Well first let me start off by saying thank you for
your reply. Also I
> guess I should tell you my level of expertise as you
can probably
> detect is not too high. Now to your reply...
>
> As to why I dont put it into one big pattern. I'm not
sure how to do
> that with the .net regex engine. So I figured I'd go
the safe route
> and just match one at a time then shove it into a local
variable.
> Maybe not as efficient but its been crunching through
about 60,000 part
> numbers pretty fast for me ;)
>
> I understand this
10[026]|15[036]|200X|20[046]|276|28[13] pattern and
> thank you for your help on it. But what I am really
stuck on with
> regular expressions is how to match a particular
character in the
> middle of string. Like I show in my previous post...
>
> With a part number = 100PHX100-22
>
> How do I match the PH (shape), X (material), 100
(maxload).
>
> Say my part can consist of ...
>
> series =
100|102|106|150|153|156|200X|200|204|206|276|281|283
>
> shape = PHU|PH|PR|PD|P
>
> material = A|B|C|D|E|F|G|H|AA|BB|CC
>
> metal = T|U|V|XX|YY
>
> load = [0-9]+
>
>
> Thanks again in advance.
>
> Matt
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Regex" group.
To post to this group, send email to regex googlegroups.com
To unsubscribe from this group, send email to
regex-unsubscribe googlegroups.com
For more options, visit this group at http://groups.go
ogle.com/group/regex
-~----------~----~----~----~------~----~------~--~---
|