Posts Tagged ‘regular expression’

Extract/Search for a specific tag in xaml/xml

They said: When you need to do this, please do NOT use regular expression cause it’s a pain! USE xpath instead! We have a very good article about using C# XPath here: Manipulate XML data with XPath and XmlDocument (C#) – CodeProject

What I said: Seem like we can not use XPath to read XAML.

Enjoy!

Advertisements

Visual Studio Find/Replace Regular Expression Usage – CodeProject

If you ever work with auto-generated code, you would get tons of warnings like me. In those cases, search and replace a pattern is in-the-need, and regular-expression is quite handy at those situations!

For my situation, I need to covert the line in the form as below:

And change it to be:

The problem is I got hundreds of lines in this need-to-changed form (generated by the Unit Test Creating feature of VS). So, I use Replace All as below screenshot and get all things ordered! Oh yeah!

 

Here’s a good review about using the regular expression!

Visual Studio Find/Replace Regular Expression Usage – CodeProject.

Have fun! Life has lots of interesting stuff to learn & we can learn!