jarvo88
1
Ok guys im looking for something sexy to split this HTML (This HAS to be
done using split, nothing else)
hi, there, fred,
I would like to split them values into an array, Is there any chance
this can be done? Because im beginning to think there isn’t
Tia
jarvo88
2
Oh, i want all the values inside the tags, btw
jarvo88
3
Lee J. wrote:
Ok guys im looking for something sexy to split this HTML (This HAS to be
done using split, nothing else)
hi, there, fred,
I would like to split them values into an array, Is there any chance
this can be done? Because im beginning to think there isn’t
Tia
There you go —
f.split(/, |,/)
where f is your string.
jarvo88
4
Lee J. wrote:
Thanks, but i need to values inside the tags, So hello I need
hello…
Quick and dirty, but it works –
f.split(/, |,/).to_s.split(//).to_s.split(/</b>/)
could not figure out how to do this in one split
jarvo88
5
Arindam G. wrote:
Lee J. wrote:
Ok guys im looking for something sexy to split this HTML (This HAS to be
done using split, nothing else)
hi, there, fred,
I would like to split them values into an array, Is there any chance
this can be done? Because im beginning to think there isn’t
Tia
There you go —
f.split(/, |,/)
where f is your string.
Thanks, but i need to values inside the tags, So hello I need
hello…
jarvo88
6
On Mon, Sep 17, 2007 at 09:03:52AM +0900, Lee J. wrote:
Ok guys im looking for something sexy to split this HTML (This HAS to be
done using split, nothing else)
hi, there, fred,
I would like to split them values into an array, Is there any chance
this can be done? Because im beginning to think there isn’t
Oh, i want all the values inside the tags, btw
str.split(/|</b>,|</b>, /)
Tia
–Greg
jarvo88
7
This one is better–
f.split(/</b>, |</b>,/)
but it leaves you with one blank cell
jarvo88
8
On Sep 16, 7:03 pm, Lee J. [email protected] wrote:
Ok guys im looking for something sexy to split this HTML (This HAS to be
done using split, nothing else)
Why won’t your teacher let you use anything
other than split?
Does he know that you are getting your answers
from this forum?
jarvo88
9
Gregory S. wrote:
Oh, i want all the values inside the tags, btw
str.split(/|</b>,|</b>, /)
I thought, among other attrocities, that < was a reserved character for
regular expressions.
Not sure about the “has to be done using .split part”, if some of us
have
studied REXML and Hpricot so thoroughly… (-;
jarvo88
10
On Sep 16, 7:03 pm, Lee J. [email protected] wrote:
Ok guys im looking for something sexy to split this HTML (This HAS to be
done using split, nothing else)
hi, there, fred,
I would like to split them values into an array, Is there any chance
this can be done? Because im beginning to think there isn’t
“hi, there, fred,”.scan(/(.*?)<.b>/).
flatten
==>[“hi”, “there”, “fred”]
“hi, there, fred,”.
split(%r{|[, ]*(?:)?})
==>[“”, “hi”, “there”, “fred”]
jarvo88
11
William J. wrote:
On Sep 16, 7:03 pm, Lee J. [email protected] wrote:
Ok guys im looking for something sexy to split this HTML (This HAS to be
done using split, nothing else)
Why won’t your teacher let you use anything
other than split?
Does he know that you are getting your answers
from this forum?
Who said it was a teacher, This was for a challenge, And you’re not
providing an answers, Just a very helpful solution…
Thank you all