a Couple of useful REgex Expressions for file names and path

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
kpassaur
Automation Wizard
Posts: 696
Joined: Wed Jul 07, 2004 1:55 pm

a Couple of useful REgex Expressions for file names and path

Post by kpassaur » Sun Mar 29, 2009 8:58 am

enjoy

Let>fileandpath=C:\aaatest1\imagesout\mark detect form sample_page_01_image_0001.tif

//Gets file name
Let>Pattern=([0-9a-z_-\s]+[\.][0-9a-z_-\s]{1,4})$
RegEx>%Pattern%,%fileandpath%,0,matches,num,0
MDL>matches_1


//Gets file name extension
Let>Pattern=\w*$
RegEx>%Pattern%,%fileandpath%,0,matches,num,0
MDL>matches_1

//Confirms Path
Let>Pattern=(?:(?#drive)\b[a-z]:|\\\\[a-z0-9]+)\\[^/:*?"pattern,fileandpath,0,matches,num,0
MessageModal>matches_1

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts