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
/
(\d+)[^,.\d\n]+?(?=arrest|custody)|(?<=arrest|custody)[^,.\d\n]+?(\d+)
/
g
Input 1
1
New
Police arrested 2 people 4 people were arrested The number 4. Arrested by police #(Sentence ended - no match) 5 people were taken into custody today
Extraction
Police arrested 2 people 4 people were arrested The number 4. Arrested by police #(Sentence ended - no match) 5 people were taken into custody today