http://www.perlmonks.org?node_id=1140639


in reply to Re^7: Interpolating subroutine call in SQL INSERT INTO SELECT statement
in thread Interpolating subroutine call in SQL INSERT INTO SELECT statement

poj,

I just managed to get the YAPE::Regex::Explain module downloaded and installed via cpanm (turned out I had some firewall/proxy issues to resolve). This is an awesome module and I'll definitely be using it more in future.

Question: waaayy back when I did compiler design, we used a tool; a lexical analyzer generator called JLex (which was a Java implementation of Lex) wherein we leveraged its built in scanner to generate tokens from an input stream. Now, the documentation for it said we generally get better performance by building specification for tokens using the longest possible RegExps. So, when matching a particular expression the more of the pattern we can provide, the better. Suffice to say instead of providing:

(amp)|(lt)|(gt);

We ought to provide:

(amp;)|(lt;)|(gt;)

What are your thoughts on this? I'm not all that well versed with Perl (or how its RegExp engine functions) so any tips would be most appreciated.

Thanks
shadowsong