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
m.

mobile radio

So I finally figured out how to stream radio to my phone. More specifically 1.FM radio. The problem came with the fact that 1.FM uses MMS to stream their radio which would work on most non-java smartphones. Unfortunately I have a u740 Java phone and so it doesn’t work.

So after about 6 months of sporatic work, I finally figured it out. I had to use VLC as a encoder to tranform the MMS stream to a mp4-latm RTP stream. After that, then use Darwin Streaming Server to take the RTP stream from VLC and broadcast it using the RTSP protocol.

So yea, now I can rock away and tell my cell company to take that 7.00/month radio package and shove it.

T.

Toshiba M200 and Dual Displays

Like me, most of you who have the infamous Toshiba M200 tablet have probably upgraded that outdated XP installation to either Windows Vista or Windows 7. And you probably upgraded the video drivers from the old 64 Forceware to the 97 or 98 Forceware off of LaptopVideo2Go. But you’ve probably also noticed a few things in regards to the display no longer work, such as Dual Displays. Fortunately there’s a solution for enabling Dual Displays in the BIOS.

Reboot your computer and hold down the ESC key before the TOSHIBA logo appears. The laptop will prompt you with an error message “Check system. Then press [F1] key.”  Press the F1 key. Once in the BIOS setup, navigate using the directional keys to get all the way over to the right side where it says Power On Display in the DISPLAY box. Press the Space key until it changes to LCD+Analog RGB. Press the End key followed by the Y key to save your changes.

And that’s it! You can now plug in your monitor to the VGA output of the tablet and enable dual displays in Windows using the mobility center. I was actually quite surprised when I could run my main monitor at 1920×1080 and the laptop LCD at 1400×1050 with out any issues.