I have a huge file of code with many lines like this:
Enterprise::TextMessageBox::Show(String::Format(S"Възникнал е проблем:\n\n{0}", e->Message), S"Грешка");
What i`m trying to do is to find every part of the code with string of cyrilic symbols with another text that i provide. My problem is that i cant seem to make good enought expressions so i can catch the lines. Another problem is that some times the lines contain only one such string but other times they contain 2 or more on one line.
Every such string is similar and it look like this:
S"some cyrilic symbols"
I tried to make it with Regex class but I can't seem to make good enough pattern to the strings.
OK you have the possibility to match for Unicode properties. Try something like this
Regex TheRegex = new Regex(@"S""[\p{IsCyrillic}\p{P}\p{N}\s]*""");
\p{IsCyrillic}
matches any cyrillic character
\p{P}
is the unicode category for punctuation
\p{N}
is the unicode category for a number in any language
\s
matches a whitespace
See here on msdn for more infos about unicode categories and here on regular-expressions.info.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With