Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

RegEx to read XML to find file paths

DamienMinter
8 - Asteroid

Hi Community, 

 

I need a bit of help from a RegEx guru to read the below and pull back the file paths as I need to be able to determine if proper UNC paths have been used.

 

Any help would be appreciated. Please note mapped drives might change ie C: / D: / E: etc as well as the actual directory and file extension

 

Input Output
  
<Directory>C:\Program Files\Alteryx\bin\</Directory>C:\Program Files\Alteryx\bin\
<Directory>\\Program Files\Alteryx\bin\</Directory>\\Program Files\Alteryx\bin\
  
<File OutputFileName="" RecordLimit="" SearchSubDirs="False" FileFormat="0">C:\Program Files\Alteryx\bin\.Myfile.yxmd</File>C:\Program Files\Alteryx\bin\Myfile.yxmd
<File OutputFileName="" RecordLimit="" SearchSubDirs="False" FileFormat="0">\\Program Files\Alteryx\bin\Myfile.yxmd</File>\\Program Files\Alteryx\bin\Myfile.yxmd
3 REPLIES 3
Thableaus
17 - Castor
17 - Castor

Hi @DamienMinter 

 

Try this RegEX formula:

 

REGEX_Replace([Input], "<.*?>", "")

 

Cheers,

SteveWayne
7 - Meteor

Put the following in the Regex tool - set to Parse

Example attached

<.*?>(.*)<.*?>

SteveWayne
7 - Meteor

Put the following in the Regex tool - set to Parse

Example attached

<.*?>(.*)<.*?>

Labels