Let’s talk Alteryx Copilot. Join the live AMA event to connect with the Alteryx team, ask questions, and hear how others are exploring what Copilot can do. Have Copilot questions? Ask here!
Start Free Trial

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

trying to do a simple parse

matthew_swanson
7 - Meteor

hello, i am trying to use the parse tool to get the number between '"date":' and ','

 

this is the string i'm working with: "....."date":1626275112,"open":2638.030029296875,...."

 

i dont see anything wrong with my regex expression.. but then again i'm not very good with regex

 

matthew_swanson_0-1626277577185.png

 

my output gets the starting position right, but it is grabbing everything after the term i'm looking for, it's not ending properly:

 

matthew_swanson_1-1626277664654.png

 

does anyone know what i'm doing wrong?

8 REPLIES 8
atcodedog05
22 - Nova
22 - Nova

Hi @matthew_swanson 

 

You can try something like this.

 

"date":(\d+),

 

only takes the numbers. This should work.

 

Hope this helps : ) 

matthew_swanson
7 - Meteor

yep that worked, but what about situations where there are decimals, (or sometimes) letters in that field?

atcodedog05
22 - Nova
22 - Nova

Hi @matthew_swanson 

 

Modify your expression like this.

 

"date":(.+),".*

 

Workflow:

atcodedog05_0-1626279721709.png

 

Hope this helps : )

 

matthew_swanson
7 - Meteor

this is odd, i've opened your example and it works, but when i literally copy your parse tool into my workflow, it doesnt work..

 

matthew_swanson_0-1626280511013.png

 

atcodedog05
22 - Nova
22 - Nova

Hi @matthew_swanson 

 

Can you try this. Quotes doesn't appear in date value and appears only when next field starts based on that I am isolating the date value. 

 

"date":([^"]+),.*

 

matthew_swanson
7 - Meteor

that worked, that's exactly what i need, thank you!

 

that said, i dont really understand why this works

 

my regex cheat sheet says that ^ represents the start of the string... i dont understand how that applies here

atcodedog05
22 - Nova
22 - Nova

Hi @matthew_swanson 

 

^ is start of string.

[^] is should not be chars in bracket.

matthew_swanson
7 - Meteor

ah ok, that is good to know! thanks again!

Labels
Top Solution Authors