Skip to content

Files

Latest commit

 

History

History
30 lines (20 loc) · 457 Bytes

Style-ExactRegexpMatch.md

File metadata and controls

30 lines (20 loc) · 457 Bytes

Pattern: Exact regexp match

Issue: -

Description

Checks for exact regexp match inside Regexp literals.

Examples

# bad
string =~ /\Astring\z/
string === /\Astring\z/
string.match(/\Astring\z/)
string.match?(/\Astring\z/)

# good
string == 'string'

# bad
string !~ /\Astring\z/

# good
string != 'string'

Further Reading