PHP regex optimize
I've got a regular expression that match everything between <anything> and I'm using this:
today but I believe that there might be a better way to do it?
\w doesn't match everything like you said, by the way, just [a-zA-Z0-9_]. Assuming you were using "everything" in a loose manner and \w is what you want, you don't need square brackets around the \w. Otherwise it's fine.
If "anything" is "anything except a > char", then you can:
Testing will show if this performs better or worse.
Also, are you sure that you need to optimize? Does your original regex do what it should?