Assume that I have a string which contains,
Some content blah blah blah
Some more random content
ParentID: Here goes the important content
I am trying to write a regex in ruby, to parse the value of "ParentID:" out of this string, this is what I have now,
def parseForParent(textForParsing)
string1 = textForParsing.match(/ParentID:([^\/.]*)\n$/)
end
This problem seems to be resolved now, check for answers below, I am trying to modify the regex so that I can limit the text that is actually related to 'ParentID'. One way of doing it is to strip all further text beyond a delimiter, or I could incorporate it in my regex.