The string will always start with /
The string may or may not end with /
The "key-goes-here" part will always be alphanumeric and - (hyphens to separate words)
The "permalink-goes-here" part will always be alphanumeric and - (hyphens to separate words)

Thanks in advance

ShaneC

04-15-2011, 04:15 PM

Try something like this:

^[A-Za-z0-9\-]+/deals/[A-Za-z0-9\-]+[/]?$

I highly recommend you look into REGEX. I avoided it for the longest time but it, truthfully, saves a lot of time and effort while programming to match user input. I found the following two things to be very helpful resources: