|
Posted by Jon Slaughter on 05/05/07 09:29
Can I use any reg exp(mainly for mod rewrite) where I can match any
character but a fixed list?
I need to match a string that does not contain any /'s but I don't want to
have to use a character search string. (I don't see any need to have to
hardcode it)
that is,
..
matches any single charactr
and (.*) matches any string
what I want to do is use something like % that means
..%/
which means match any character but /.
Of course it would need to be valid and I know I can't make up semantics for
the reg ex. My point is is that, is that I don't want to have to use
[a-z0-9\-%&^$#@!etc...] to mean . but not /.
Surely there is a way to exclude a few characters from . without having to
increase the complexity of the expression 1000 fold?
If you don't get that, then a simple example would be that I have an
arbitrary string and I want to match only if that string does not contain an
a. Sure I can so something like
[bcdefghijklmnopqrstuv1234567890!@#$%^&*()_+][';/.,<>?:"{}+-=~`..........................]
but surely reg exp has an easier way??? (again, this is specifically for mod
rewrite)
Thanks,
Jon
Navigation:
[Reply to this message]
|