Hi there,
i have a simple workflow here that I am trying to extract the middle two digit as shown in the table below.
I been using regex_match([AM],'\.\d{2}\.',1) in the formula tool to do the extraction however it keep returning me 0 as shown below. Please do let me know where did I made the mistake in the regex.
I had attached the workflow for reference. I do understand that i can opt to perform the extraction easily with text to column tool. However , i do have my reason why I would prefer to use formula tool instead as part of my larger workflow. Also , i would need to keep the [AM] column as string, hence i could not opt to convert to date format and extract the month instead.
Thanks.
Solved! Go to Solution.
SubString([AM],3, 2) should work! RegEx Match is only going to give you if it matches or if it doesn't
If you're trying to extract the middle two, you would need to use Regex parse, which requires the regex tool. You can do a formula without regex as well. Substring([AM],3,2) to extract this if this is always the format. For Regex parse, you would use "\d{2}:(\d{2}):\d{4}.*". Again that would always need to be the pattern.
@alexnajm I wish there was a way for pages to update with additional comments without having to refresh my browser!
Thanks both!
both methods works for me really thanks alot!
Agreed @jdminton !