Monday, November 27, 2006
At work today I was doing some searching in a C# file to find strings that we haven’t translated. E.g. messages to the user and so forth. I thought using RegExp to do this would be a good idea. That made me think of a joke I heard from Scott Hanselman at TechEd this year:
“You have a problem and find out you have to solve it with RegExp. Now you have two problems…”.
Anyway, I did a search and found the syntax I was looking for at http://msdn2.microsoft.com/en-us/library/2k3te2cs%28VS.80%29.aspx. To solve my problem I used :q, which gave me hits like “some string”. I guess I could have gone even further and made it even more specific for my search, but this was sufficient for me. I’ve used quite a bit of RegExp before and it’s really powerful, once you get used to it. And that is probably the biggest problem with RegExp, it’s hard! When you finally have memorized some syntax, a week later it’s gone. And also that it vary a lot from implementation to implementation. Like RegExp in Find is not the same as RegExp in C#.
All comments require the approval of the site owner before being displayed.
Name
E-mail
Home page

Comment (Some html is allowed: a@href@title, b, blockquote@cite, em, i, strike, strong, sub, sup, u) where the @ means "attribute." For example, you can use <a href="" title=""> or <blockquote cite="Scott">.  

Live Comment Preview