=begin
Repetition
. * - Zero or more times
. + - One or more times
. ? - Zero or one times (optional)
. {n} - Exactly n times
. {n,} - n or more times
. {,m} - m or less times
. {n,m} - At least n and at most m times
Repetition is greedy by default
A greedy metacharacter can be made lazy by following it with ?
Note Quantifires are greedy, add a ? to make it lazy.
=end
=begin Repetition . * - Zero or more times
. + - One or more times
. ? - Zero or one times (optional) . {n} - Exactly n times . {n,} - n or more times . {,m} - m or less times . {n,m} - At least n and at most m times
Repetition is greedy by default A greedy metacharacter can be made lazy by following it with ? Note Quantifires are greedy, add a ? to make it lazy. =end
p /\d*/ =~ "safdfs434"
p "Hello".match(/[[:upper:]]+[[:lower:]]+l{2}o/)
p "".match(/<.+?>/)
p /[[:upper:]][[:lower:]]/.match("Hello")