cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
jacquenv
Nintex Newbie

Extracting 4 digit year out of date using Regular Expression?

Jump to solution

Regular Expression is bewildering.  I know dozens of programming languages at a basic-intermediate level and this one throws me for a loop!  Yes I have seen all the documentation and did Google searches but I just don't get the logic. 

 

I have a workflow that I did not build and this Regular Expression pattern is not coming through like it is on the original list (rebuilding it).  Looks like the date format is even completely diffierent than the new one. 

 

All I need is the year from the date... In this case, 2019.

Variable holding the date contains: 4/23/2019 3:42:11 PM

 

Labels: (1)
Tags (1)
0 Kudos
Reply
3 Replies
nico
Nintex Newbie

Re: Extracting 4 digit year out of date using Regular Expression?

Jump to solution

Hi,

you can use this regex:

(\d{4})

It say : I want the 4 consecutive digit, and in a date, there is no other 4 digit consecutive thant the year

View solution in original post

Reply
jacquenv
Nintex Newbie

Re: Extracting 4 digit year out of date using Regular Expression?

Jump to solution
It took out the year but left me with everything else... This was my output: 4/24/ 8:29:48 AM
0 Kudos
Reply
eharris04
Nintex Newbie

Re: Extracting 4 digit year out of date using Regular Expression?

Jump to solution

Here is a video walking through how to apply the regex that @nico provided. It does work and you can import the workflow if needed.

 

Reply