try this regex in Matches activity. You can tweak it to make it suit better for your needs.
^\s*\d+\s*([A-Z]+)\s.*$

2 Likes
Hi @Rahul_Tomar1
Use the activity Matches. You can keep the below setup:
Regex Pattern = \s(\d+)\s(\w+)
Use For Each activity:
Keep the below setup, Groups(1) will hold the numbers, Groups(2) will hold AAAA, BBBB etc.

Thanks @kunalhore2891
Now suppose in group 2 there are 7 words like AAAAAA,BBBBBB… And
In an folder we have 15 text files. From which 7 different text files have these 7 words written.
Can we search each word like AAAAAA in every text file and fild out which file have this word.
Without using for each, can we assign group2
@Rahul_Tomar1 - Regexvar(0).groups(2).tostring…
For Reference…
U can read an entire text file using Read Text File activity. It will store the data of the text file into a string variable. Let us assume the name of the variable is TextFileString
To see if a keyword exist in this text file you can use::
TextFileString.Contains( keyword )
If it returns True then the file has that keyword.