Question

I need to find a string for example: 20140605 and I'd like to change the 20140605 to yyyy-mm-dd format without changing characters, just separating year from month and from day... I tried with regular expression like

([0-9]{4}+)([0-9]{2}+)([0-9]{2}+) 

but it didn't even find the string.

What's the right regex for this case? My notepad is 5.8.2

Was it helpful?

Solution

How about:

find what: \b([0-9]{4})([0-9]{2})([0-9]{2})\b
Replace with: $1-$2-$3

OTHER TIPS

([0-9]{4})([0-9]{2})([0-9]{2}) is probably what you're looking for. {4} means there has to be four of the previous items, adding + after it won't work.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top