If I understand you correctly - you want to allow strings that begin with a forward slash and contain no periods, question marks or end with a forward slash? If that is the case, then try this :
^[/][^?.]*[^\/.?]$
(It's off the top of my head so it may need some tweaking but should be close)
Breakdown
^ //Starts Regular Expression
[/] //A single forward slash is required
[^?.]* //Any number of non period or question mark characters allowed
[^\/.?] //Cannot end with a forward slash, a period or question mark
$ //Ends Regular Expression
hegdesachinv
Member
16 Points
10 Posts
Regular Expression Format
Jan 28, 2013 12:16 PM|LINK
Hi All,
I've to validate a string with the following criteria using regular expression
Help on the above is appreciated. Thanks in advance.
Regards,
Sachin
Rion William...
All-Star
32068 Points
5215 Posts
Re: Regular Expression Format
Jan 28, 2013 01:05 PM|LINK
If I understand you correctly - you want to allow strings that begin with a forward slash and contain no periods, question marks or end with a forward slash? If that is the case, then try this :
(It's off the top of my head so it may need some tweaking but should be close)
Breakdown
Examples
hegdesachinv
Member
16 Points
10 Posts
Re: Regular Expression Format
Jan 28, 2013 01:11 PM|LINK
Hey thanks a lot..that did the trick and thanks for the breakdown and the examples as well...:)