Just for grins, this tests about 50% quicker than the substr version in your benchmark.
sub is_sorted{ my( $str, $p, $x ) = ( lc shift, 0 ); chop$x lt $x and return 0 while $x = substr $str, $p++, 2; 1; };
In reply to Re: Re: Re: Regexp for alphbetical order match within the string
by BrowserUk
in thread Regexp for alphabetical order match within the string
by prostoalex
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |