Greetings,

I am still fairly a newbie with Perl regexes. So today was a momentous
occasion that I wrote a regex without looking at a book, manual, or example,
and had it work on the first try!

However, there is always room for improvement, so I'd appreciate if you
could critique my work and offer any suggestions on how to improve
robustness, performance, etc.

The regex is designed to look at an oracle/sql query, determine if there is
a hint included, and then extract the hint. Generally hints look like this:

/*+ FIRST_ROWS DOMAIN_INDEX_SORT */

So here is my regex:

if ($query =~ /\/\*\+\s+(.*)\s+\*\//) {
  $hint = $1;
}

It does what it's supposed to - for all of the tests I've run, $hint
contains the text of the hint, if one exists.  But I'm sure it could be much
better, so please, poke away.

Thanks,

Peter
--
Peter R. Wood - [EMAIL PROTECTED] - http://prwdot.org/

Reply via email to