I had been looking on the Internet for a solution to a program I had be working on and sadly didn’t come up with one. I was trying to find a way to use regular expressions to find all the html anchor tags in a string along with matching a wild card URL (ie: secnem.com.*test.html). And after many hours of thrusting my head into my keyboard I came up with:

/<a [^><]*href=[\”\’][^\”\’><]*<rule>[^\”\’><]*[\”\’][^>]*>\s*.*\s*<\/a>/iU

You’d replace <rule> with what ever url rule you want, except for any wild cards in the url I needed to use [^\”\’><]* instead of just .* . This would prevent it from matching outside of the anchor. Bascially [^\”\’><]*  means: match any character except a double quote, single quote, greater than sign, or less than sign. All of which should not be in the href field to begin with.

If you wanted to see what the content of the anchor tag was or the matched href, simply put some brackets around like so:

/<a [^><]*href=[\”\’]([^\”\’><]*<rule>[^\”\’><]*)[\”\’][^>]*>(\s*.*\s*)<\/a>/iU

Hope this helps someone. You can of course adapt this to other html tags by replacing ‘a’ for ‘table’ or w/e. Same with the href. larsolavtorvik.com has a great resource for testing regex in real time and addedbytes.com has a great cheat sheet as well.

Previous ArticleNext Article
T.

Toshiba M200 + Vista Ultimate = ?

Well they don’t have a word for it yet.

But anyway, I did indeed install Vista on my lowly Toshiba M200 (exact specs except I have 1GB of DDR, soon to be 2GB). So far, I’m quite impressed at the overall performance of the machine, the system lags a bit more then XP did but the functionality and ease of use went up. I’m thoroughly impressed with the Vista Tablet functionality vs XP Tablet.  Surprisingly enough, my frame rate in World of Warcraft (yes it can play on the M200) is pretty much the same as it was in XP.

One thing I noticed right away was the responsiveness of the Tablet Pen, it seems to have increased quite a lot. I also combined that with OneNote 2007 which with the improvements from 2003 has made my note taking a lot more easier.

Would I recommend upgrading to Vista on the M200?

Sure. Make sure that you have at least 1GB of memory however, and I’d recommend installing Vista from a folder on lets say a network or USB drive. The reason for this is the 24x External Toshiba drive sucks for transferring files, if you go that route be read to spend a good 1-2 hours getting to the “Installing” screen. I installed Vista from XP from a folder on my network storage. Took about 1 1/2 hours to install from the time I first ran the installer to when I could first login to the machine.

I will say that anyone who wants to upgrade will need 2 things:

And that’s it, Vista will take care of the rest. If you download/install anything else from Toshiba, you’re installing too much redundant/old software. I say you should download Toshiba Tablet PC Button Driver because it contains the drivers needed to change the Display Brightness and Rotate the screen. Once installed you can use the Vista Mobility Center (press Windows Key + X) to rotate the screen and change the Display Brightness depending on your power status.
Mobility Center
Mobility Center