Click here to Skip to main content
15,887,135 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to match certain pattern Please help
website1/somestring/
website1/somestring/default.htm
website/somestring

but i need to exclude

website/xyz

xyz = particular string which i want to exclude
website1/somestring/anything 

from above line after slash i want to allow only default.htm or space
anything other than this i want to exclude

i tried with below line
/website1/(.*)/[^*\S]*$

but not working for all combination
please help
Posted
Updated 9-May-12 8:22am
v2

I'd start here[^]: they may have something close to what you want that you can adapt.
 
Share this answer
 
Comments
Rakesh S S 9-May-12 13:08pm    
Not able to find the pattern i want
R. Giskard Reventlov 9-May-12 14:04pm    
Seriously? Did you even try? You have to find something close and then adapt it to your needs or find and read through some regex documentation (of which there is much) and work it out.
Rakesh S S 10-May-12 3:17am    
i want string with / followed by nothing
example:
website1/abc/

and
string with / followed by default.htm
example:
website1/abc/default.htm

both should work
i want string with / followed by nothing
example:
website1/abc/

and
string with / followed by default.htm
example:
website1/abc/default.htm

both should work

many thanks
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900