---
source: crates/ruff/src/rules/pycodestyle/mod.rs
---
W605_1.py:2:10: W605 [*] Invalid escape sequence: `\.`
  |
2 | #: W605:1:10
3 | regex = '\.png$'
  |          ^^ W605
4 | 
5 | #: W605:2:1
  |
  = help: Add backslash to escape sequence

ℹ Suggested fix
1 1 | #: W605:1:10
2   |-regex = '\.png$'
  2 |+regex = '\\.png$'
3 3 | 
4 4 | #: W605:2:1
5 5 | regex = '''

W605_1.py:6:1: W605 [*] Invalid escape sequence: `\.`
  |
6 | #: W605:2:1
7 | regex = '''
8 | \.png$
  | ^^ W605
9 | '''
  |
  = help: Add backslash to escape sequence

ℹ Suggested fix
3 3 | 
4 4 | #: W605:2:1
5 5 | regex = '''
6   |-\.png$
  6 |+\\.png$
7 7 | '''
8 8 | 
9 9 | #: W605:2:6

W605_1.py:11:6: W605 [*] Invalid escape sequence: `\_`
   |
11 | #: W605:2:6
12 | f(
13 |     '\_'
   |      ^^ W605
14 | )
   |
   = help: Add backslash to escape sequence

ℹ Suggested fix
8  8  | 
9  9  | #: W605:2:6
10 10 | f(
11    |-    '\_'
   11 |+    '\\_'
12 12 | )
13 13 | 
14 14 | #: W605:4:6

W605_1.py:18:6: W605 [*] Invalid escape sequence: `\_`
   |
18 | multi-line
19 | literal
20 | with \_ somewhere
   |      ^^ W605
21 | in the middle
22 | """
   |
   = help: Add backslash to escape sequence

ℹ Suggested fix
15 15 | """
16 16 | multi-line
17 17 | literal
18    |-with \_ somewhere
   18 |+with \\_ somewhere
19 19 | in the middle
20 20 | """
21 21 | 


