Reputation: 1052
I got a file with the following structure:
[section1]
item1 = text1
item2 = text2
item3 = text3
[section2]
item1 = text4
item2 = text5
item3 = text6
...
and i will find the section to a text. e.g. text is "text6" it should return "section2".
I tied:
content.scan(/(^\[.*?\]).*?#{text}/m)
but that is only returning the first section of the file :/ (i use ruby)
Upvotes: 0
Views: 160