PDA

View Full Version : Match any length of any characters in mod_rewrite regex?


coasters2k
06-30-2006, 06:25 AM
I'm writing an Apache mod_rewrite regular expression and I'm trying to make it allow a string of any characters of any length (it's not used for any purposes other than making the URL more informative) and I'd figure it'd be as easy as this:

/[.]*/

I omitted the parenthesis since I don't need it to be a variable but that doesn't work (I assume since . only allows 1 character?)

I know the following works with my intended results:

[a-zA-Z0-9~!@#$%^&*()_+\/>]+

but I figure there must be some code that is better where I don't have to define all the characters. Any ideas?

schleppel
06-30-2006, 01:46 PM
What's wrong with .*? (Or ".+" if you want one or more characters?)

You could also paste your actual mod_rewrite code.