Created
January 29, 2021 21:54
-
-
Save bjoerntx/3b9b1f0b8d6d44f25d25fb18fa899f81 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class MyExtensions { | |
public static MatchCollection Find( | |
this TXTextControl.TextControl tx, | |
string pattern, | |
RegexOptions regexOptions) { | |
// replace the CRLFs with LFs to be compatible with | |
// TextControl's index | |
var sText = tx.Text.Replace("\r\n", "\n"); | |
// new RegEx and return the matches | |
Regex rg = new Regex(pattern, regexOptions); | |
return rg.Matches(sText); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment