PDA

View Full Version : Regex and Read File step


modernrocketry
01-10-2014, 06:39 PM
I'm trying to use regex in a Read File Step. I'm looking for a substring match. However I cannot get VBP to return a positive results regardless of how vague the regex.

Is there a problem using regex in 8.4 ( or more likely... what am I doing wrong?)

Using VBP 8.4

Here are the steps to see my issue:


<step action='Log Message'>
<Level type='3'>4</Level>
<Message><![CDATA[The quick brown fox jumped over the lazy dog.
There were 614 instances of students getting 90.0%% or above.
The FCC had to censor the network for saying &#$*@!]]></Message>
<buildfailsteps type='11'>0</buildfailsteps>
<indent type='3'>1</indent>
<name>Log Message</name>
</step>
<step action='Read File'>
<AllMatches type='11'>-1</AllMatches>
<Encoding>ASCII</Encoding>
<FailNoMatch type='11'>-1</FailNoMatch>
<Find>\w</Find>
<Input type='3'>1</Input>
<Log type='11'>-1</Log>
<NoModS type='11'>-1</NoModS>
<String>%LASTSTEP_OUTPUT%</String>
<buildfailsteps type='11'>0</buildfailsteps>
<indent type='3'>1</indent>
<name>Read Output of Last Step and regex something</name>
</step>

kinook
01-10-2014, 11:24 PM
Define a group capture for the expression: (\w)

Or uncheck Include all matches and use something like \w*

Shiamak
03-17-2014, 04:52 PM
Define a group capture for the expression: (\w)

Or uncheck Include all matches and use something like \w*

Above works great however using VBP's regular expressions how do you parse one or two or three digits from either a string or a file?

(/d/d) works only for two digits.

kinook
03-17-2014, 05:07 PM
\d+ or \d{2,3}
http://www.regular-expressions.info/repeat.html

Shiamak
03-17-2014, 05:14 PM
\d+ or \d{2,3}
http://www.regular-expressions.info/repeat.html

Thanks.. I figured out ^(\d+).