Kinook Software Forum

Go Back   Kinook Software Forum > Visual Build Professional > [VBP] General Discussion
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 01-10-2014, 06:39 PM
modernrocketry modernrocketry is online now
Registered User
 
Join Date: 04-06-2006
Posts: 19
Regex and Read File step

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>
Reply With Quote
  #2  
Old 01-10-2014, 11:24 PM
kinook kinook is online now
Administrator
 
Join Date: 03-06-2001
Location: Colorado
Posts: 6,034
Define a group capture for the expression: (\w)

Or uncheck Include all matches and use something like \w*
Reply With Quote
  #3  
Old 03-17-2014, 04:52 PM
Shiamak Shiamak is online now
Registered User
 
Join Date: 02-07-2006
Posts: 84
Quote:
Originally Posted by kinook View Post
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.
Reply With Quote
  #4  
Old 03-17-2014, 05:07 PM
kinook kinook is online now
Administrator
 
Join Date: 03-06-2001
Location: Colorado
Posts: 6,034
\d+ or \d{2,3}
http://www.regular-expressions.info/repeat.html
Reply With Quote
  #5  
Old 03-17-2014, 05:14 PM
Shiamak Shiamak is online now
Registered User
 
Join Date: 02-07-2006
Posts: 84
Quote:
Originally Posted by kinook View Post
Thanks.. I figured out ^(\d+).
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



All times are GMT -5. The time now is 04:28 AM.


Copyright © 1999-2023 Kinook Software, Inc.