- Jan 25, 2009
- 6,378
- 3,774
Hey all, I know enough about regular expressions to be dangerous. I would like to match this format:
I don't want to match the words exactly, but what I want to match is words with dashes inbetween.
So basically
xxxx-xxxx-xxxx-xxxx-xxxx
To see if I can make it more complex here the words could be anything, and any length, so
xx-xxxxxxx-xxxxx
or
xxxxx-xxxxxxxxxxx-xx-xxxxxxxx-xxxxxxxxx
etc...
How do I do this effectively?
At least it would be two words with a dash, at most probably 16 words with dashes between.
Allowing for numbers in addtion to words would be ideal.
Also anything that ends with .html I don't want.
So
xxxx-xxxxx-xxxxx-xxxxxxxxx.html
I don't want that, I only want it if its just words and dashes.
I am trying to build an url filter.
Any ideas on how I could do this?
Thanks in advance for your time.
Code:
broadway-basketeers-deluxe-chocolate-and-nut-collection-gourmet-snack-gift-basket
So basically
xxxx-xxxx-xxxx-xxxx-xxxx
To see if I can make it more complex here the words could be anything, and any length, so
xx-xxxxxxx-xxxxx
or
xxxxx-xxxxxxxxxxx-xx-xxxxxxxx-xxxxxxxxx
etc...
How do I do this effectively?
At least it would be two words with a dash, at most probably 16 words with dashes between.
Allowing for numbers in addtion to words would be ideal.
Also anything that ends with .html I don't want.
So
xxxx-xxxxx-xxxxx-xxxxxxxxx.html
I don't want that, I only want it if its just words and dashes.
I am trying to build an url filter.
Any ideas on how I could do this?
Thanks in advance for your time.
Last edited: