stdlib/regex/literals_parens.rb
tests/_examples/stdlib/regex/literals_parens.rb in the metorex repository.
r = /hello/
puts(r)
r2 = /world/i
puts(r2)
a = 10
b = a / 2
puts(b)
r3 = /[a-z]+\d+/
puts(r3)
r4 = /hello\/world/
puts(r4)
Output:
(?-mix:hello)
(?i-mx:world)
5
(?-mix:[a-z]+\d+)
(?-mix:hello\/world)