I have to clean a string passed in parameter, and remove all lowercase letters, and all special character except :
- +
- |
- ^
- space
- =>
- <=>
so i have this string passed in parameter:
aA azee + B => C=
and i need to clean this string to have this result:
A + B => C
I do
string.gsub(/[^[:upper:][+|^ ]]/, "")
output: "A + B C"
I don't know how to select the =>
(and for <=>
) string's with regex in ruby)
I know that if i add string.gsub(/[^[:upper:][+|^ =>
]]/, "") into my regex, the last =
in my string passed in parameter will be selected too