@siddharth what problem might that be ? I think I can;t upload my word document here because its confidential… But is there anyway to restrict the search to just the first page of the word document and still be able to run the regex to get the pattern.
That’s okay. But you can create a SAMPLE with dummy details.
Anyway, when you do “Add data row”, you’re adding the entire iEnumerable object “modulename” from the “matches” activity. The output from the “matches” activity (modulename) gives you a list of all possible matches as an IEnumerable object. Hence your output is what you shared with us.
Try using a “foreach” activity to traverse through this IEnumerable object. But since, I believe, there will only be one module code per document, even for each isn’t required. Just simply use “modulename(0).toString” instead of “modulename”. See what you get and tell me if that works for you.
@siddharth Sorry, may I ask where do I do the modulename(0).toString at ?
In your workflow, you’re using “Add data row”, right? You’re using {modulename} there. Instead of that, use {modulename(0).toString} (Assuming this modulename variable is for the module code.)
@siddharth
I had a typo its supposed to be modulecode and I did the same exact thing this is the error it gave me when I run it.
Ok let me see when i will get free time.
Regards.!!
Aksh
hi @aksh1yadav thanks for replying I will wait for it!
That’s what I was gonna tell you since you were getting the right value. Anyway, good job! (y)
Exactly what I was telling you. Unless we have the entire input, any generic regex we make might match something we do not want.
Question: Does the module code ALWAYS come before the module name?
@siddharth yes it will always appear before the module name. sometimes it might not have any module code and just the module name alone like the first example.
Try this once: ([A-Za-z]{2}[0-9]{4})(?=[a-zA-Z ]+)
Let me know if it works.
@siddharth after i changed the pattern to whatever you wrote I got this error:

That’s because you used the first document, didn’t you? In the first document, you won’t get any module code, will you? So your “modulename” variable will be null. So, before you use any object, always check if it is null or empty. Use the document that has the module code first and tell me if it works.
Right before you use “Add data row” use an If activity. Check if modulename.count>0. Put your “Add data row” activity inside the “then” part of the If activity. Nothing goes in else part.
@siddharth Thank you your so good! its working. I have many other things that I will have to extract let me give it a try first, might need your help again
![]()
Sure, Jovian. Either you can create another thread for it OR you can PM me as well. Whenever I’m free, I’ll help you out.