Re: what's wrong with my method and regular expression?
- From: equinox <aditya15417@xxxxxxxxx>
- Date: Wed, 17 Dec 2008 17:16:14 -0800 (PST)
On Dec 17, 6:08 pm, equinox <aditya15...@xxxxxxxxx> wrote:
On Dec 17, 6:04 pm, Chris Hulan <chris.hu...@xxxxxxxxx> wrote:
On Dec 17, 7:07 pm, equinox <aditya15...@xxxxxxxxx> wrote:
The code is
http://pastie.org/341880
And i want it to return
nilwww.yahoo.co.in
/~testing/i.html
but when I run this code, why doesn't thewww.yahoo.co.indetected?
You might want to play with your regex on Rubular (http://
rubular.com/)
A little experimentation shows that you probably want to include
'http://'
in your input string
cheers
the code should work for both, if there's no http:// then it should
print out:
nilwww.yahoo.co.in
/~testing/i.html
if there is then it should print:
httpwww.yahoo.co.in
/~testing/i.html
anyway thanks for the rubular link I was able to fix the code using
it...
.
- References:
- what's wrong with my method and regular expression?
- From: equinox
- Re: what's wrong with my method and regular expression?
- From: Chris Hulan
- Re: what's wrong with my method and regular expression?
- From: equinox
- what's wrong with my method and regular expression?
- Prev by Date: Re: what's wrong with my method and regular expression?
- Next by Date: Re: Your word frequency calculator?
- Previous by thread: Re: what's wrong with my method and regular expression?
- Next by thread: Help with Hpricot and collect
- Index(es):
Relevant Pages
|