Dear all,
I'm trying to extract the first 10 digits and last 4 digits of the following filename: "0423855851 DRAFT PS 2021.xlsx"
Any chance you can help me write the correct regex to use with the regex tool in alteryx ?
@charlescooks One way of doing this. I am not sure you want all the numbers in one column or separate columns like below.
Hello @charlescooks . You can also use the below regex expressions for extracting first 10 and last 4 digits.
Thanks!!
If you only want get the numeric of filename, follow this formula:
1- Get all number:
REGEX_Replace([FileName], "^(\d{10}).*(\d{4}).+?$", "$1$2")
2- Get First 10 number :
REGEX_Replace([FileName], "^(\d{10}).*(\d{4}).+?$", "$1")
3- Get last 3 number:
REGEX_Replace([FileName], "^(\d{10}).*(\d{4}).+?$", "$2")
*******
Please mark this as the solution if it answers your question, it will help others to find solutions quicker.