2 ms·
In case of ruby, best would be to actually use result of match for futher computation like this: if !m=/^[a-z0-9 ]+$/match(str) return "Bad Input" end str
by Borg3 2y ago
In case of ruby, best would be to actually use result of match for futher computation like this:
if !m=/^[a-z0-9 ]+$/match(str)
return "Bad Input"
end
str=m[0]