Using the .NET framework, I am trying to change the double slash characters in a string with a slash, but it looks like
To remove an extra character and why I do not know.
I have a string:
http: // localhost: 4170 / RCRSelfRegistration // Default.aspx
My regex Is:
[^ (| // |: \\\\)] (\\\\ | // | \\ / | / \\)
and return value is:
http: // localhost: 4170 / RCRSelfRegistratio / Default.aspx
You can see that in RCRSelfRegistration N has been removed. I'm not sure why.
/// & lt; Summary & gt; //// Match on double slash (//, \\, / \, \ /) but there is no match: // or: \\ /// & lt; / Summary & gt; Personal prong string strMATCH = @ "[^ (| // |: \\\\)] (\\\\ | // | \\ / | / \\)"; /// & lt; Summary & gt; /// Double Change Slash with Single Slash /// & lt; / Summary & gt; /// & lt; Param name = "strUrl" & gt; & Lt; / Param & gt; /// & lt; Returns & gt; & Lt; / Returns & gt; Public Stabilized String GetUrl (string string) {string strNewUrl system. Text.RegularExpressions.RegexRxReplace = New System.Text.RegularExpressions.Regex (strMATCH); StrNewUrl = RxReplace.Replace (strUrl, "/"); Return strNewUrl; } [First part of Regex "]" [^ (: // | <: <:
Do you probably want to do this, this pattern should be seen on the zero-width side, to make sure that the slash character is one Initiative No colon.
Comments
Post a Comment