Extracting Text from URL

Simple question.

https://www.google.ca/maps/place/Montreal+University+Station/@45.4945078,-73.6023214,2934m/data=!3m1!1e3!4m5!3m4!1s0x4cc919f2b2bfdc2d:0x81f74ad077d1548b!8m2!3d45.5032132!4d-73.6181617

I would like to extract d45.5032132!4d-73.6181617 from the end and converted to N45.5032132 W73.6181617

Thank you Kindly…
Bill

I think the below macro I just posted should meet your needs, as I understand them. Please review/test the macro, and post your feedback here. There are links to both solutions at RegEx101.com.

###MACRO: Extract Data with RegEx from End of URL

Please note there are at least TWO possible solutions. You may want to review the various forms your source URL will be in, and adjust the RegEx.

###Possible RegEx Solutions
USER CHOICE: Review these solutions and choose the one best for your use case.
Copy the RegEx expression and paste into the “Search Variable” Action.

FIRST SOLUTION – See https://regex101.com/r/tyAOOA/1
Allow for any digit to precede the Capture Groups
This is the most flexible solution.

`\/@.+?!\dd([\d.]+)!\dd\-([\d.]+)`

SECOND SOLUTION – See https://regex101.com/r/X37oty/1
Requires specific numbers prior to the Capture Groups:
!3d AND !4d
This is the more reliable solution.

`\/@.+?!3d([\d.]+)!4d\-([\d.]+)`
1 Like

**Thank you Very much! **

You are very kind Been Baning my head on this one…

1 Like

Glad it worked out for you Bill.

1 Like