Please enable JavaScript to use regex101
/
^
r
e
g
e
x
[
\
-
_
]
?
1
0
1
$
/
i
Reg
ular
Ex
pressions
101
Upgrade to Pro
Enterprise
Regular Expression
/
#(?!.*>)(.*)$
/
gm
Input 1
1
New
----------------- ---MATCH CASES--- ------------------------------------------------ $text = "Hello"\t# Comment after tab $text+= #Comment without space after hash Write-Host $text# Comment without space before hash #Comment line with no whitespaces around' Write-Host "Hello"#Comment in the end with no whitespaces around' # Comment with whitespaces around ' # Consecutive comments # Last line comment without line ending in the end $text+= #Comment with < inside $text+= #Comment ending with > $text+= #Comment with <# inline comment #> # Normal comment Write-Host "Comment without text" # -------------------- ---NO MATCH CASES--- ------------------------------------------------ Write-Host "Hello" Write-Host "World" Write-Host "Non-empty line" $text = "Hello" <# block comment #> + "World" $text = "Hello" +<#comment#>"World" <# Block comment in a line #> Write-Host "Hello world <# Block comment in the end of line #>