Regex Question..

Posted by Josh on Stack Overflow See other posts from Stack Overflow or by Josh
Published on 2010-06-17T13:58:50Z Indexed on 2010/06/17 14:03 UTC
Read the original article Hit count: 235

Filed under:
|

Hello everyone-

In my C# Console App I'm trying to use Regex to search a string to determine if there is a match or not. Below is my code but it is not quite working right so I will explain further. sSearchString is set to "_One-Call_Pipeline_Locations" and pDS.Name is a filename it is searching against. Using the code below it is set to true for Nevada_One-Call_Pipeline_Locations and Nevada_One-Call_Pipeline_LocationsMAXIMUM. There should be a match for Nevada_One-Call_Pipeline_Locations But Not for Nevada_One-Call_Pipeline_LocationsMAXIMUM. How can I change my code to do this properly?

Thanks in advance

if (Regex.IsMatch(pDS.Name, sSearchString))

© Stack Overflow or respective owner

Related posts about c#

Related posts about regex