ShawnMolloy
MIS
I'm trying to create a reg ex expression for a URL rewriting .net handler that will find user names that precede a web url and redirect them based off their ID to a certain page. Example:
The regex expression should look for a string that doesn't have an extension I guess. Here is the code that parses the regex:
Can you help write this expression?
Thanks!
Shawn Molloy
Seattle, WA
The regex expression should look for a string that doesn't have an extension I guess. Here is the code that parses the regex:
Code:
public string GetSubstitution(string zPath)
{
Regex oReg;
foreach(XmlNode oNode in _oRules.SelectNodes("rule")) {
oReg=new Regex(oNode.SelectSingleNode("url/text()").Value);
Match oMatch=oReg.Match(zPath);
if(oMatch.Success) {
return oReg.Replace(zPath,
oNode.SelectSingleNode("rewrite/text()").Value);
}
}
return zPath;
}
Can you help write this expression?
Thanks!
Shawn Molloy
Seattle, WA