Here is my test string that I'm trying to capture using ruby:
<?lang
this_should_be_captured();
and_also_this();
and_this();
?>
this text should NOT be captured
<?lang this_should_also_be_captured(); ?>
When I use this regular expression:
(<\?lang(\n|.)*\?>)
The match captures everything (including the part that I don't want: "this text should NOT be captured"), as shown on http://rubular.com/r/qSOOzq6HAx.
How can I capture the two different blocks correctly without capturing what I don't want?