You are viewing limited content. For full access, please sign in.

Question

Question

regular expressions month digit to month word

asked on March 15, 2018

For some background I have a client with an archive department that will be digitizing records. For this reason they need to be able to enter the date of the actual document. 

 

I'm filing by year\month\documents

 

I can extract the year by \d{4} and I can extract the month by \d{2}. Is there a way to convert the month digit to the month name (i.e. 02 = Feb) without having to create 12 different conditional decisions? 

0 0

Answer

SELECTED ANSWER
replied on March 15, 2018 Show version history

You can use the token dialog and then the formatted token option:
MMM will give an abreviated month for a date,  Feb
MMMM the full month name,  February

You do have to supply a date, not just the month number:  02/02,  02/02/2018



You can format your entire date string at once:  %(dateValue#"dd-MMM-yy"#)
returns 02-Feb-18 from 2/02/2018
Look at the Date options from the ? help next to the Formatted token input.

1 0

Replies

replied on March 15, 2018

I just tried that and it worked perfectly. Thank you!

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.