/^a-eg-h/.match(‘f’) gives null in Ruby
As has been mentioned in the comments, your pattern is incorrect. It appears that you’re attempting to use a character class, but have neglected to include the surrounding square brackets. Your pattern, as it currently stands, will only match on strings that start with the literal text a-eg-h. The pattern you want is: /[^a-eg-h]/ Additionally, … Read more