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{2}-\d{2}-\d{4}) *[-:]? *([A-Z\d].*)|([A-Z\d].*)(?<![ :-]) *[-:]? *(\d{2}-\d{2}-\d{4}))$
/
gmi
Input 1
New
23-05-1990 Some heading 27-05-1990 Liar Liar Pants on Fire 29-05-1990 Another Heading 30-05-1990 50/50 31-05-1990 My day Liar Liar Pants on Fire 27-05-1990 Another Heading 29-05-1990 50/50 30-05-1990 My day 31-05-1990 23-05-1990 : Some heading 27-05-1990 : Yes Man 29-05-1990: Another Heading 30-05-1990 - 50/50 31-05-1990 - My day
Substitution
$1$4 $2$3\n
23-05-1990 Some heading 27-05-1990 Liar Liar Pants on Fire 29-05-1990 Another Heading 30-05-1990 50/50 31-05-1990 My day Liar Liar Pants on Fire 27-05-1990 Another Heading 29-05-1990 50/50 30-05-1990 My day 31-05-1990 23-05-1990 : Some heading 27-05-1990 : Yes Man 29-05-1990: Another Heading 30-05-1990 - 50/50 31-05-1990 - My day