Focal Point
Regex Inside Properties File

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/1381057331/m/5057040626

November 09, 2012, 10:40 AM
benicely
Regex Inside Properties File
I'm using a XDFileDirListAgent to find the count of files in a directory.

This directory might have other files in it, so I've created the following regex to only count the number of files I'm interested in.

\d{4}-\d{8}-\d{8}-\d{2}-\d{2}-\d{8}-\d{6}\.csv


This works fine when I have this regex inside my selection expression, but when I attempt to move it into a properties file, I always get a count of zero.

I know the properties file is working, as I have many other variables for other objects in there and those are being read fine.

Here is how I'm trying to call my regex from my properties file.

_property(_concat(_sreg(iwayhome), _sreg(myproject.propertyfileloc)), filecountregex)


Here is my regex inside of my properties file.

#File Pattern Regex
filecountregex = \d{4}-\d{8}-\d{8}-\d{2}-\d{2}-\d{8}-\d{6}\.csv


Can anyone tell me why this isn't working?

Thanks.

This message has been edited. Last edited by: benicely,


WebFOCUS 7.6
Windows, All Outputs
November 12, 2012, 07:42 AM
Charles Maheu
I think you need to double all the "\" in the property file since it's interpreted as a string.

It should be like this in your property file
#File Pattern Regex
filecountregex = \\d{4}-\\d{8}-\\d{8}-\\d{2}-\\d{2}-\\d{8}-\\d{6}\\.csv


WebFocus 7.6.8
OS: Windows
iWay: 6.1.4
November 12, 2012, 10:50 AM
benicely
That did the trick. Thanks for your help!


WebFOCUS 7.6
Windows, All Outputs