Closed proyb6 closed 6 years ago
Is there a way to free regex in variable that should not be change through out lifetime? It appear I couldn't get the match working.
Working:
/^[A]{1}[0-9]{6}[A-Z]{1}$/.match?("A123456A".freeze) ? "" : res << {"IC" => "err1"}
Wanted:
ic = Regex.new("/^[A]{1}[0-9]{6}[A-Z]{1}$").freeze
What do you want?:
Regexp object is immutable currently so OnigRegexp#freeze should work.
OnigRegexp#freeze
Is there a way to free regex in variable that should not be change through out lifetime? It appear I couldn't get the match working.
Working:
Wanted: