Fix regex match group handling after moving to case statements
The rubocop autocorrect for Style/CaseLikeIf does not take into account the match operator for regex, which in this case returns the matched data when using it with and if/elsif statement. After just moving this to an case statement, the data is not returned anymore. This could be fixed by using the `$LAST_MATCH_INFO` pseudo variable which contains the whole `MatchData` object of the latest regex matching group.
Please register or sign in to comment