lucy24 - 1:47 am on Apr 19, 2013 (gmt 0)
brainsuccess: If your URLs really do contain literal periods-- some do, most don't-- there are better solutions than to dump the [^.]+ element and replace it with .+ (not .*, which is clearly unwarranted and can lead to capturing malformed requests).
Take, f'rinstance, the typical URL over at apache dot com, where there is often a "2.2" or "2.4" or similar in the middle. If you wanted to capture this, you'd say
Some apache installations are grumpy and require [0-9] in place of \d. Or, if you're unaccustomed to reading Regular Expressions and your brain freezes when it meets a form like \d or \s you may be better off investing the three extra bytes ;)
But the key thing in this example is: If the character following the literal . is not a numeral, then the RegEx stops its search immediately, spits out the . and skips to the end of the parentheses.