Start a new topic

RegEx to keep timestamp, remove date

I want to keep the timestamp from my Gift Date field, to add as a Gift Attribute.  I know how to remove the timestamp from the date, but does anyone know how to remove the date from the timestamp instead?

 

For example:

Original Value: 01/01/2015 12:00:00

Value to keep: 12:00:00

 

Thanks,

Sheryl


How are you removing the timestamp from the date?

I think I would just do something like:
Value to replace:.* (.*)
Replace with: $1

Value to replace (because it's hard to read here) is: period star space left-paren period star right-paren
Hi Wayne - we are using the following regular expression: (?
Thanks so much for your feedback.

Sheryl
what value is replaced by that? It kind of just looks like it is finding 4 consecutive numbers.

This is what we have:

Replacement Value: --Blank--

Values to match on: (?

 

 

 

 

Hi Wayne - We currently have the following:

3/10/2015 10:52

After using the --Blank-- for the Replacement Value and (?

 

Hope this helps.

 

Thanks,

 

Sheryl

ah, I get it.

So what that is doing currently is looking for anything after 4 consecutive numbers and replacing that with blank.

Did you try what I originally suggested? Does it work?
Unfortunately, your first suggestion did not work. When I test it, it gives me the same data I put in. It does not take anything out.

Do you have any other suggestions?
Sheryl,

This should work for you.
Replacement Value: Blank
Value to match on: [0-9]{1,2}/[0-9]{1,2}/[0-9]{4}(?= *.)

It will leave a leading space in the time which I'm sure could be removed by adjusting the regex. IOM removes leading and trailing spaces anyway so it won't be an issue.
Login or Signup to post a comment