in reply to calling all reg exp masters!!

If this is a serious question please provide more details about your application, and the data's context.

I assume that you want to match data in the form of those three individual strings.

  1. Your first string can be matched easily enough: /[A-Z]-\w+-[A-Z]-\w+-\w+ \w+/
  2. Your second string requires more advanced knowledge of your data, and what to look for to determine the boundaries.
  3. The third is also fairly easy (I'm assuming that the first and last strings always match): /([0-9A-Z]{5,5})_[0-9A-Z]{5,5}_\1/

This code is just off the top of my head, but the basic idea should be plain. Clearly we'd have to know more about the variations allowed for the data, and the data that we need to *avoid* matching.


You can always combine multiple searches into one giant 'or' fest, /search1|search2|search3/. However that's much more confusing to read, harder to debug, and much slower than individual searches.

With a deep knowledge of your data, and what you are trying to match, you *might* be able to create an aggregate reg-ex that was more efficient than three searches, but probably not.

Ardemus - "This, right now, is our lives."