Please enable JavaScript to use regex101
/
^
r
e
g
e
x
[
\
-
_
]
?
1
0
1
$
/
i
Regular
Expressions
101
Regular
Expressions
101
Upgrade to Pro
Enterprise
Regular Expression
/
((^|\s)#(.*)$)|(^\n)|(\n(\s|)+#(.*)$)|([\n\s]+#.*)|([\n\s]{2,}$)
/
gm
Test String
New
#This RegEx removes inline comments and blank lines in python code! # This will save you tokens and time when using GPT to help code and debug. import requests import os #Define vars def add(a, b): return a + b # print results result = add(2, 3) print(result) # Output: 5 print("Complete")
Extraction
Processing...