c# - Regex: Do not match if pattern at the end of the string -


I have the following regex, where I want to match any clear dot with one or more:

  & lt; P & gt; & Lt; I & gt; & Lt; U & gt; & Lt; / P & gt; & Lt; / I & gt; & Lt; / U & gt;  

If this happens at the end of the string, then this rajax should not match this method.

  string = Regex.Replace (string, "\. ((& Lt; [\ / biu] +>) +)", ". $ 1 ||")  

ex:

  this & lt; B & gt; Match is needed. & Lt; / B & gt; Okay. This & lt; I & gt; & Lt; B & gt; Should not match. & Lt; / B & gt; & Lt; / I & gt;  

  "\. ((& Lt; [\ / biu] + Use Negative Intent with the  $  symbol to check for the end of the line> +) (?! $) " 

(Remember, $ is the end of the match line, so you match not .)


Comments