Error on expression

image
Please help me it works fine on one xaml when i change the function to another xaml i got this error
This is very urgent pls help me to rectify this error

@Sudharsan_AIT ,

In the code change this and try,

Cast(Of System.Text.RegularExpression.Regex.Matches).Select(Function(m) m.Value).ToList()

Getting this error
image

@Sudharsan_AIT - it is cast of Match …not matches …

Same error is shown

@Sudharsan_AIT - This is my working code, which is almost similar to what you are trying…

image

Please show us your complete asssign statement with the variable type.

My whole expression is like
System.Text.RegularExpressions.Regex.Matches(input_data,".*(?=Acord)").Cast(Of Match).Select(Function(m) m.Value).ToList().Where(Function(r) r.ToString<>"").Count.ToString
I need to change anything here

@Sudharsan_AIT - I see no error when I added this…Since I dont have the input data, mocked input data as string for testing purpose…

image

StrCount is String Variable…

Note: Import the below if its still showing an error

image

How to import that bro

@Sudharsan_AIT - just type in the search bar on the import tab as system.text.regular.expressions

when i click on the System.Text.Regulare Expressions
image

still same error

Where you clicked??? I am not sure…

image

What is the variable type of CountGDPR?

Please share the text which you are getting for pbdw1, i will share the code for you…

Comunicari in vederea derularii contractului de furnizare e.e. Acord Dezacord
Comunicari Marketing, campanii si comercializare produse Acord Dezacord
Participarea la sondaje de piata Acord Dezacord

@Sudharsan_AIT - ok thanks…you want the count of matches??

I have screen scrapped from the app
I just need the count of rows

@Sudharsan_AIT - Here StrTest is your text input, in your case pbdw1…

   Strtest.split(Environment.NewLine.ToCharArray).count.ToString

Please check and let us know…

It is showing the result as 5 bro
In my case i am only having 3 rows

@Sudharsan_AIT - You gave a 3 line text and When i am running i am getting count as 3…you getting 5…something is not right here…

Let me try the Regex route…

@Sudharsan_AIT - Please try this…

system.text.RegularExpressions.regex.Matches(Strtest,".+(?=Acord)").Count.ToString

.* - will give 5 matches, That’s why I adjusted it to .+ which gives only 3 matches…

1 Like