Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static string StripStringFormating(string formattedString)
- {
- if (rTest.IsMatch(formattedString))
- return rTest.Replace(formattedString, string.Empty);
- else
- return formattedString;
- }
- static Regex rText = new Regex(@"e[[d;]+m", RegexOptions.Compiled);
- static Regex rTest =
- new Regex(@"(e([([d;]*[mz]?))?)?", RegexOptions.Compiled);
- "(e[(d{1,2};)*?[mz]?)?"
- public static string StripStringFormating(string formattedString)
- {
- return rTest.Replace(formattedString, string.Empty);
- }
- (?s)(?:e[(?:(d+);?)*([A-Za-z])(.*?))(?=e[|z)
- <ESC>[1;32mThis is bright green.<ESC>[0m This is the default color.
- [ [1, 32], m, This is bright green.]
- [0, m, This is the default color.]
Add Comment
Please, Sign In to add comment