Daily Archives: May 27, 2009

VO –> Vulcan regex

We’re about to do a bunch of ‘Transporting’ from VO to Vulcan in the next few days so I’m probably going to figure out a bunch of useful tricks for helping to automate the process.

So far things are looking good, our unit tests our now transporting cleanly and there’s no incompatibilities exposed by them.

One thing I did need to do was remove all the PSZ <-> STRING conversions.  The easiest way to do that was to use Visual Studio’s ‘Replace in files’ option and some regex’s.

String2Psz({.*}) 
AsPsz({.*}) 
Psz({.*}) 
AsString({.*}) 

They are the things you want to find, replace them with \1

Note that Visual Studio doesn’t appear to support .*? so those matches may be too eager.  In my case I just ended up with extra brackets left around my variables.  Syntactically okay but ugly looking.

Thinking about it, I have the feeling last time I gave up on Visual Studio and just used perl the last time I needed to do this.  I guess if I have any more complex things to do I will.

Tagged , ,
Follow

Get every new post delivered to your Inbox.

Join 58 other followers