![]() If you are planning on searching source code, you will need to add the RegexOptions.Multiline option to span multiple lines, otherwise you will have to apply the Replace() one line at a time. Your list of reserved words can be added to the pattern if needed. This pattern picks up "symbols", not just "identifiers", so words like IF THEN ELSE will get converted to if then else. The Replace method uses a simple delegate (a Lambda expression in this case) to replace the match with the lower case version of the match. So the pattern finds only symbols with uppercase or digit (I could have said \b+\b instead, but I chose a more educational form). (If you don’t understand HTML, don’t worry. For example, let’s say you need to add the HTML italic tags and around anything formatted with italic.![]() string pattern = test = "one One ONE TWO2 Three fOur F5IVE" Ĭonsole.WriteLine("] is just a fancy way of saying - meaning remove lower case from the matchable characters. Replacing with Find What Text If you’re faced with a complex task using Microsoft Word’s Find and Replace feature, the Find What Text replacement code may come in handy.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |