Hi Community,
I have a string of address data where im trying to pull out the first number from it. EG 23 Caldowd98 Road, i'd like to pull out the 23, the first number.
Is there a Regex funtion out there that will allow me to do this ? Thank you !
Solved! Go to Solution.
Hi @CalDowd98,
This will work as long as there is a space following the first number set:
.*?(\d+?)\s+
hi @CalDowd98 ,
The expression below would work too for parsing out your data.
..\s*(\d\d)
the \s* is an optional space expression.
i hope this helps!
Hi @CalDowd98,
You could simply use (\d+) inside a regex tool. This would extract the first (and only the first) number in the string, in this case "23". No need to over complicate it unless we have to otherwise we're just increasing processing time and memory used, slowing the workflow down.
If this solves your issue please mark the answer as correct, if not let me know! I've attached my workflow for you to download if needed.
Regards,
Jonathan
Hi Jonathan,
Thanks for the help works great !
Just one last thing, if i have the street number 23a for example, how would i get the first letter as well if its stung together ?
thanks !
Hi @CalDowd98,
You could change it to (\w+) this would extract the first alpha numeric characters.
If this solves your issue please mark the answer as correct, if not let me know! I've attached an updated workflow for you too.
Regards,
Jonathan
HI John,
Thanks for the help 🙂
This doesn't quite solve it unfortunately. There are times when i have a house name invloved which im looking to extract into a different column afterwards.
EG Callum House 23 Callum Drive, 25b Callum Drive
Im just looking to get the 23 and 25b, currently it will get Callum and then 25b
Any tips ?
thank you again !
Could you attach a table of perhaps 5 records with columns of the data you're looking to extract from each?