I am trying to extract data from a string using regex and have that extracted data become the value of the new column.
I have read through https://parabola.io/transform/use-regex and many Q&A from the community, but cant quite find the answer to my problem.
The string is a URL
Example: https://www.test.com/item-name-t3-2?source=twi&medium=twi%6tFeed&campaign=WM+-+6%36+YAY+Targeting+4.3+%e6%8b&content=93746788475070651&ad_id=6384778084577065&twiid=PBCa8s4MYMdOFo1zYcHMKUXRaXFh6Zkhq%5fBuvlHPLnZbfI6Y%5em
My expression works on the site: https://regexr.com/
My Expression: (?<=ad_id=)\d*|(?=&)
Which would result in capturing the ad_id 6384778084577065
The Problem:
When I make my regex call it is just removing the ad_id from the url and inserting the new url as the value for the new column.
URL Column= https://www.test.com/item-name-t3-2?source=twi&medium=twi%6tFeed&campaign=WM+-+6%36+YAY+Targeting+4.3+%e6%8b&content=93746788475070651&ad_id=6384778084577065&twiid=PBCa8s4MYMdOFo1zYcHMKUXRaXFh6Zkhq%5fBuvlHPLnZbfI6Y%5em
NEW Column = https://www.test.com/item-name-t3-2?source=twi&medium=twi%6tFeed&campaign=WM+-+6%36+YAY+Targeting+4.3+%e6%8b&content=93746788475070651&ad_id=&twiid=PBCa8s4MYMdOFo1zYcHMKUXRaXFh6Zkhq%5fBuvlHPLnZbfI6Y%5em
I am wanting the NEW column to be: 6384778084577065
and if no ad_id is found leave column blank