in reply to Regex MATCH

G'day stallion,

Your problem is that * matches zero or more times. For DOC_001_123:

  1. $Prefix matches DOC_
  2. [a-zA-Z]* matches zero times
  3. [0-9]* matches zero times
  4. -* matches zero times
  5. [0-9a-z]{3} matches 001
  6. no further matching in regexp: /$Prefix[a-zA-Z]*[0-9]*-*[0-9a-z]{3}/ successfully matches DOC_001_123

That may be enough for you to fix your code. If not, please post a more representative sample of your tags: given the [a-zA-Z]* in your regexp, I assume some tags are more complicated than those posted here.

-- Ken