Domanda

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

È stato utile?

Soluzione

How about:

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

Altri suggerimenti

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

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top