Monthly Archives: September 2010

Virtual PC: Switching between virtual pc and host pc

Once you start using your virtual PC, how do you get control back to the host PC? The help document of VPC says to press the host key, but what on earth is the host key? It’s the right ALT key of your keyboard. Not any ALT key, but the RIGHT ALT key. Press it and the mouse control comes back to your host PC.

You can launch your virtual PC in full screen mode. Once you have done that, how do you quit full screen mode? Again, press host key and enter. That is RIGHT ALT + Enter.

Simple, yet it took me some time to figure it out.

Regular expression for a line with only white spaces

I had this requirement to check whether the input string contains only white spaces. I am not a regular RegEx user, so it took me some time to achieve this.

^[ \t\r\n]*$

That’s it. The meaning of the above pattern is [Beginning of line] [0 or multiple white spaces] [End of line]. Note that this pattern matches an empty string also, since we have given * after white spaces. If you want to strictly look for white spaces and exclude empty strings, then change the * to +.

This is not such a big deal that it requires a blog post of its own, but I didn’t find this information when I looked for it. So putting this out there for anyone who comes looking for it.

Follow

Get every new post delivered to your Inbox.