I have a problem regarding filtering text between 2 words, the string that I'm trying to filter looks like this:
Word 1
this is text
more "text"
this is more text
end
Word 3
this is more text
more "text"
this is more more text
end
What I am trying to do is filtering the pieces of the text between "Word" and "End" and put them seperatly in an 2d array like so
array = [["this is more text /n more "text" /n this is more text"]["this is more text /n more "text" /n this is more more text"]
What I have now atm is this:
test = []
result = string.san(/Words.(.*?)end/m)
res.each do |r|
test.push(r[0])
end
return test
Any help will be greatly appreciated Kind regards
See Question&Answers more detail:os