Hi there,

I have a string that needs to have some portions extracted through
regexp and add them to an array.

the string is something like this:

"<fruits><banana /><orange /></fruits> <vehicles><suv /><pickup
/><vehicles> <fruits><apple /><banana /></fruits>"

So the regexp should return all that's between all <fruits> and
</fruits> in this case, it should be something like this:
"<banana /><orange /><apple /><banana />"

then using
myArray = myString.split(myRegexp);

I would get an array that looks like this
["<banana /><orange />", "<apple /><banana />"]

I've tried this regexp: "<fruits>.*?</fruits>" but it's not really
working, as it gives me whatever is outside the fruit nodes.

Any pointers?

Thanks,
Claudia

Reply via email to