Hello!
I am trying to modify a javascript regex (written by a 3rd-party) to add support for xml namespaces, which is simply any 2 words separated by a colon, i.e., word1:word2
Here is the orginal regex definition (does not recognize word1:word2)
- tagTokenRe = /^(#)?([\w-\*]+)/
Note: I believe the # (pound sign) is used as a template character that gets replaced by various strings at run time. It is not a literal match to '#'
Here's a regex that I wrote that works, BUT it breaks other use cases.
- tagTokenRe = /^(#)?([\w-\*]+:?[\w-\*]+)/
I've tried other variations with no luck. All of my changes break the application (the regex is in a common subroutine).
So, I'm desparate for a new regex that will match word1:word2 without changing ANY other patterns matched by the original. All help is truly appreciated.