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
r"
\(\d{4}(?:[\s–—-]+(?:\d{4}|present))?\)
"
gi
Input 1
1
New
The Adventures of Sherlock Holmes (1891–1892) (series), (1892) (novel), Arthur Conan Doyle This is Agent (1857), the years were (1987-1868), which lasted from (1678- Present)
Extraction
The Adventures of Sherlock Holmes (1891–1892) (series), (1892) (novel), Arthur Conan Doyle This is Agent (1857), the years were (1987-1868), which lasted from (1678- Present)