I am using the regex to split the string. I am using Matches to see if I can find the instances of the regex matches.
As Shown in the screen shot, I am using Read text file to get the input string, then using Matches activity in which I am using certain regex into regex builder, and the required fields are being seen as shown in the figure.
But when i am running this module and using message box to print the count of the regex matches, it is always showing as ZERO!!!
I tried using qualifiers are “Exactly” and also “Atleast 1”, but still get 0 as total regex instances.
Okay, So on a high level I want to read the text file and use the regex to separate the input text file input string into multiple sub strings.
So in this case, I was just wondering why is Matches not able to give me the count of the FOUND INSTANCES.
SO in this img, there are around 28 instances which are being highlighted using this text info and the above mentioned regex. But when I am just trying to get the count and print into message box, it always showns zero.
I mean if its not able to find any instance then why would it even show it in the regexBuilder.
Because when you read the text file, the line doesn’t end in \n, but in \r\n.
Replace your regex with \|[a-zA-Z0-9]{3}\r\n+ and see if that returns your desired result.
Some of the fluctuations are bcz the whitespaces in between so sometimes it wont match even the Regex is right
Just check this now whether it works or not.
Hope this may help to solve your issue
Mark as solution if this helps you and like it