Kinook Software Forum

Kinook Software Forum (https://www.kinook.com/Forum/index.php)
-   [VBP] General Discussion (https://www.kinook.com/Forum/forumdisplay.php?f=2)
-   -   Read File step - regex question (https://www.kinook.com/Forum/showthread.php?t=4471)

kodakdave 04-20-2010 07:56 AM

Read File step - regex question
 
I'd love to see an example of Read File using a regex with a non-capturing group. My step is matching the lines correctly, but even non-capturing groups are captured when I choose "Include all matches":


-1
-1
%FOLDER%\p4changes.txt
(?:Change )([[0-9)]]+)
-1
LIST
1
-1
3
Read File


I get result of:

Change 106
Change 105
etc.

but I need result of:

106
105
etc.

kinook 04-20-2010 10:32 AM

1 Attachment(s)
You can use negative lookahead to skip text. See the attached sample.

kodakdave 04-20-2010 11:15 AM

That did not work. Many other numbers besides the one "right after" the word "Change " also are captured now. Not sure what negative lookahead is supposed to accomplish.

By offering a workaround, and because non-captured grouping appears to work correctly in the "one match" case, I guess this is just a bug?

kodakdave 04-20-2010 11:35 AM

truly unfortunate. If this non-capturing group would work on "all matches" in the file instead of only the first one, I would not have to write all kinds of tedious code to compensate. oh well....

kinook 04-20-2010 12:00 PM

Including of non-capturing groups appears to be an issue with the regex library being used (or a problem in the way we're calling it), which we will investigate -- please provide a sample of the input string/file you are using.

In this case, could you just remove the 'Change ' prefix while processing the loop values (i.e., [Split("%LOOP_VALUE%")(1)])?

kinook 04-20-2010 03:07 PM

This is fixed in the latest download (VisBuildAct.dll version 7.5.1.2 in Help | About | Install Info).

kodakdave 04-20-2010 03:31 PM

can't wait to try it!! THANKS

kodakdave 04-21-2010 08:56 AM

Happy to report that this behaves as it should now. great service from Kinook! Thanks all.....


All times are GMT -5. The time now is 08:37 PM.


Copyright © 1999-2023 Kinook Software, Inc.