+ 3
The output of 0 is correct, as the regex finds and output the index of the match = 0 l="abcde" puts l=~/ab?/ if you use this: l="xye_eabcde" puts l=~/ab?/ the output will be (index) 5
14th Feb 2020, 11:10 AM
Lothar
Lothar - avatar