[Wtr-general] Need Regular Expression help with a URL string
Paul Carvalho
tester.paul at gmail.com
Thu Jan 11 13:43:47 EST 2007
Thanks Alan! That works better than what I was trying to do. Now I can
create the new URL with a line like:
new_url = ie.url[/(.*)\//] + "new_page.html"
Sweet! I was trying expressions like =~ /\&\// but wasn't having any luck.
Cheers! Paul C.
On 11/01/07, Alan Ark <arkie at compli.com> wrote:
>
> Hi Paul.
>
> The following should work:
>
> irb(main):001:0> web_url = 'http://foo/bar.html'
>
> => "http://foo/bar.html"
>
> irb(main):002:0> web_url=~/(.*)\//
>
> => 0
>
> irb(main):003:0> p $1
>
> "http://foo"
>
> nil
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070111/14e3f615/attachment.html
More information about the Wtr-general
mailing list