문제

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

도움이 되었습니까?

해결책

How about:

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

다른 팁

([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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top