In Ruby, i would like to detect keywords like ‘feed’ or ‘f’ followed by either whitespaces or special characters.
I did something like :
if m = (/\A(feedback|feed|f)\s*([A-Za-z0-9_#;\s\?@&'"()]*)\z/i.match(command))
puts m[2]
end
However, this does not work as expected. What is the best Regex to match these keywords?
This should work to match anything after the keyword: