On Dec 26, 2006, at 21:20, gaurav bagga wrote:

> hi,
>
> was just going trough reg exp
> the lines below just hangs irb and cpu usage goes 100% on windows xp
> can anyone explain me why?
>
>
> irb(main):001:0> r=/^(https?:\/\/)?[a-z0-9]+([\.\-\_=&\+\/\?]?[a- 
> z0-9]+)+$/i
> => /^(https?:\/\/)?[a-z0-9]+([\.\-\_=&\+\/\?]?[a-z0-9]+)+$/i
> irb(main):002:0> "
> http://groups-beta.google.com/group/rubyonrails-talk/browse_th
> read/thread/8f085b191387d799/e78a71cbd7354c0c#e78a71cbd7354c0c"=~r
>
> i'll appreciate if anyone helps with this.

There's already a library for what you want to do:

require 'uri'

uri = URI.parse "http://groups-beta.google.com/group/rubyonrails- 
talk/..."

-- 
Eric Hodel - drbrain / segment7.net - http://blog.segment7.net

I LIT YOUR GEM ON FIRE!