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
/
(?<!\S)Hello(?=[!,.\s]|$)
/
gm
Input 1
New
If you test Hello, Hello!, Hello or Hello it returns true as expected. If you test .Hello, aHello or Helloa it returns false as expected. However I have two problems: It returns true if you pass it Hello:, Hello?, Hello) etc. which is not what I want, only !, , , . should be allowed.
Extraction
If you test Hello, Hello!, Hello or Hello it returns true as expected. If you test .Hello, aHello or Helloa it returns false as expected. However I have two problems: It returns true if you pass it Hello:, Hello?, Hello) etc. which is not what I want, only !, , , . should be allowed.