in reply to Re: regexp: extracting info
in thread regexp: extracting info
If you want to match a line in a multiline string, you need the m-modifier and the line-begin (^) and line-end ($) indicator.
You can read about those in the perldocs already meantioned.
Going with your specification so far:
I need to extract "10" however there might be 2 or 3 words preceding.and
a very large multi line string, and only one line looks likt describe
Going with this, i would suggest:
$str =~ /^(?:\w+\s+){2,3}10$/mThere might be other restrictions you want to place on your match (more specific whitespace preceding the 10? optional whitespace (or even other words) after the 10?)
We don't know. You have to make up your mind, what the appropriate pattern is.
|
|---|