I usually use the Expresso tool to design regex patterns, especially as they get complicated. It shows a breakdown that clearly states what each bit of the regular expression does. Check out the other posters (Marc / Logicnp) for an answer to the OP issue.
Tim croydon
source share