I saw a few solutions and came up with the following code. My desired result is 100.02. The required result is always between 'my launch duration=' and 'mins'
mystring ='2012-07-11 22:30:33,536 INFO: 00/00/164/ABCTimeTest: my launch duration= 100.02 mins|z-vndn'
mypattern = /^.*=([^mins]*)/
subst = mystring.match(mypattern)
puts subst
output with the above code: 2012-07-11 22:30:33,536 INFO: 00/00/164/ABCTimeTest: my launch duration= 100.02
Whats wrong in my pattern? correct me with my understanding of this pattern.
#/
#^.*= ## move from start till = (now I have reached till '=')
#([^mins]) ## capture somethings that starts with mins (thats my 100.2)
#/