Here are two lines from some text that I wanted to change
Dorset Rd (5) - 2018-12-14 11-01-05
Crampton Chas - Sandarra Blvd - 2018-12-27 12-31-56
I’m trying to move the date and time from the end of each line to the start to produce this
2018-12-14 11-01-05 - Dorset Rd (5)
2018-12-27 12-31-56 - Crampton Chas - Sandarra Blvd
Through reading this forum (thanks to you all), I have come up with the following regex
(^.*)\s-\s(.*$)
And used this as the replacement
$2 - $1
This works fine, but I have two questions:
- I’m wondering why the ‘\s-\s’ found the last occurrence of ‘ - ‘ instead of the first?
- Could this have been better done by picking up the last 19 characters and somehow moving them to the start?