Let's use this as sample data :
text=<<EOF
#if A==20
int b = 20;
#else
int c = 30;
#endif
And this code :
puts text.scan(/\#.*?\#/m)
Why is this only capturing this:
#if A==20 int b = 20; #
I was expecting this to match as well:
#else int c = 30; #
What do I have to modify so that it captures that as well? I used /m
for multiline matching, but it doesn't seem to work.