Click here to Skip to main content
15,896,498 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
Hi,
I need the pattern matching for the following url
http://test.abc.com/a1-tours-pvt-ltd-business-1234
Posted
Updated 17-Feb-12 0:09am
v3
Comments
CPallini 17-Feb-12 5:47am    
'Patter Matching' assumes the existence of a pattern. I don't see any pattern in you post.
lukeer 17-Feb-12 6:43am    
System.Text.RegularExpressions.Regex regEx = new System.Text.RegularExpressions.Regex("http://test.abc.com/a1-tours-pvt-ltd-business-1234");
System.Text.RegularExpressions.Match match = regEx.Match(inputString);
bool found = match.Success;

;-)

1 solution

Craete a RegEx which contains the pattern you want to match. The Regular Expressions Cheat Sheet[^] helps you out defining the correct pattern. Once you've tried it yourself and still cannot get it to work, post a comment with the pattern you've tried and we will see if we can help you.
 
Share this answer
 

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