Crystal: String#scan(Regex) not finding all matches

Created on 16 Oct 2016  路  1Comment  路  Source: crystal-lang/crystal

match_result = nil
"hello".scan(/.l/) do |m|
  match_result = m
end

match_result # => el

I expect match_result in the above example to be ll

Crystal 0.19.4 (2016-10-07)

Most helpful comment

Try .(?=l).

>All comments

Try .(?=l).

Was this page helpful?
0 / 5 - 0 ratings