You are viewing limited content. For full access, please sign in.

Question

Question

Curious cloud workflow regular expression issue

asked on May 2, 2024

I'm splitting up a set of text by lines and then parsing out the lines in Laserfiche Cloud workflow.  I've tried splitting the lines various ways using pattern matching.  Both *. and [^\r\n]+ work fine when the data on each line is small.  However, once the data on a line goes past 96 characters, I get some weird behavior.

To replicate, add a pattern matching activity to a workflow.  Use one of the above regular expressions.  Click on "test" and put in the following for the test data:

123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456
Next Line

Run the test and it should work as expected.  Now, replace any of the digits with a space character:

123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789 23456
Next Line

The result now looks like this:

123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789
23456
Next Line

Somehow, after 96 characters, the regular expression is interpreting the space as a new line.  Reduce the input one character like this:

123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789 2345
Next Line

Now, I get the expected result with only two lines of data and two multivalued inputs.

My apologies if word wrapping makes this a bit unclear.  I've attached image examples that show the behavior a bit more clearly.

I haven't eliminated the possibility that I'm just using a poor regular expression.  I've tested the data and regular expression on other testers and it seems to work fine outside of Laserfiche cloud.  It even seems to work fine in the On-prem workflow designer.  If there's a better regex, I'm all for it.  If not, is this maybe a bug?

CloudRegexWorking.png
CloudRegex95ChrsWorking.png
CloudRegex96ChrsFails.png
0 0

Answer

SELECTED ANSWER
replied on May 2, 2024

Oh, CSV files stored as text. Yes, there is a maximum number of characters per line. Anything that exceeds that gets moved to a new line.

0 0

Replies

replied on May 2, 2024

That looks like a display issue where the line wraps in the test result. If you switch it to "first value only", you still get everything before "Next Line". If you move the space earlier in the string, you still get everything before "Next Line". So the first line is a single result, the space just makes it wrap because the font in the textbox is 12px while the test result uses a 13px font.

2 0
replied on May 2, 2024

I think there is some sort of wrapping going on but I'm clearly getting extra values in my multivalue fields when I do this.  I went back and did more testing.  It appears that wrapping begins at about 184 characters in my input text file (uploaded to the LF cloud repository).  Is this maybe a limitation on the way Laserfiche stores the text file?

CSVTokens.png
CSVTokens.png (20.4 KB)
0 0
SELECTED ANSWER
replied on May 2, 2024

Oh, CSV files stored as text. Yes, there is a maximum number of characters per line. Anything that exceeds that gets moved to a new line.

0 0
replied on May 2, 2024

The text file itself seems to be the culprit.  It looks like there is a 183 character limit at which the last space is replaced with a newline character.  When I create a token with a 184 character string and a space in it, the workflow runs fine.  But when my input source is the text file, this becomes a problem.

TXTLineLimit.png
TXTLineLimit.png (19.42 KB)
0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.