I ~love~ regular expressions. I do know that they’re slow compared to strstr, strpos, or whatever your language’s equivalents are, because they are yet a different coding language that gets PARSED and COMPILED. At their basic level, they represent a finite state machine (this is not so much true with modern regex, but the basic commands in like POSIX regex are).
Therefore - long regular expressions are going to be SLOWER than shorter ones. Personally… I’d have taken the article’s long ‘or’ string and broke it up into a loop over a list of allowed elements (easier to add onto later too).
Its super powerful though, however you cut it. Its one of those tools that programmers need to know, because often times its the best tool for the job - especially in the text-based web world.