Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
Perl
Perl Misc
Does Perl combine multiple REs into a single automaton?
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="Clint Olsen, post: 4765881"] Ok, that makes sense. I didn't think it would be possible to combine them. It's just that Perl behind the scenes must be doing some sort of weird execution for these if/else/branches since they are never 'visited' in the debugger. It just immediately jumps to the code block. I was wondering about that, too - Write a megapattern with capture buffers and just test the capture buffers for which action to take... FWIW, I just took the regular expression set for all the keywords of my language and merged it with the reserved symbols into a larger pattern separated by an alternation. Since the action code was identical, I thought it would be a reasonable test. Unfortunately in my case, I didn't notice any particular speed difference. As you said, this could be because the pattern is slightly more complicated now or perhaps statistically speaking the symbols just aren't seen often enough to make a difference... Thanks, -Clint [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
Perl
Perl Misc
Does Perl combine multiple REs into a single automaton?
Top