If you really want to do it in a single replacement.
You have to use conditional replacements but it is unreadable and unmaintainable !
- Ctrl+H
- Find what:
(?:(Jan)|(Feb)|(Mar)|(Apr)|(May)|(Jun)|(Jul)|(Aug)|(Sep)|(Oct)|(Nov)|(Dec))-?(\d\d)
- Replace with:
01(?1.01.)(?2.02.)(?3.03.)(?4.04.)(?5.05.)(?6.06.)(?7.07.)(?8.08.)(?9.09.)(?10.10.)(?11.11.)(?12.12)20$13
- TICK Match case
- TICK Wrap around
- SELECT Regular expression
- UNTICK
. matches newline
- Replace all
Explanation:
(?: # non capture group
(Jan) # group 1, Jan
| # OR
(Feb) # group 2, Feb
| # OR
(Mar) etc.
|
(Dec) # group 12 Dec
) # end group
-? # optional hyphen
(\d\d) # group 13, 2 digits
Replacement:
01
(?1.01.) # if group 1 exists, print .01.
(?2.02.) # if group 2 exists, print .02.
etc.
(?12.12) # if group 12 exists, print .12.
20 # 20
$13 # content of group 13, the 2 digit year
Screenshot (before):
![enter image description here](https://cdn.statically.io/img/i.sstatic.net/gzATP.png)
Screenshot (after):
![enter image description here](https://cdn.statically.io/img/i.sstatic.net/SoAsU.png)
((Jan)|(Feb)|(Mar)|(Apr)|(May)|(Jun)|(Jul)|(Aug)|(Sep)|(Oct)|(Nov)|(Dec))-(([0-4])\d|[5-9]\d))