web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id : O4S9LbRj0p4ABxH8j8+J1G
Power Automate - Power Automate Desktop
Unanswered

Extracting Text from PDF and finding the Keywords

Like (1) ShareShare
ReportReport
Posted on 9 May 2025 16:46:32 by 2
Hi, 
 
I am extracting text from pdf and searching for 50 keywords which are Transaction 1, Transaction 2 up to Transaction 50. After extraction, I am passing each keyword(Transaction1) and searching for keyword to extract the pdf pages and creating sub pdf files depending on the keyword. I ran in to an issue where, Transaction 1 is being detected from Transaction 11 and Transaction 2 is being detected when I pass Transaction 21, Transaction 22 etc.
 
As these items are dynamic, I cannot use Parse Text. I tried using text boundaries - "\\b" & %CurrentItem% & "\\b" on a variable and passing this value to Parse Text action to get the result but the variable is just appending \\b to the text.
 
Please let me know how to achieve this.
 
Thanks in advance!
Categories:
  • stampcoin Profile Picture
    4,012 Super User 2025 Season 2 on 09 May 2025 at 20:43:29
    Extracting Text from PDF and finding the Keywords
    I assume that currentItem is integer/Number
    if currentItem =1 , target = \bTransaction\s+1(?!\d)
    • \b is a word boundary to ensure "Transaction" isn’t part of a larger word.
    • \s+ matches the space (or any whitespace) after "Transaction" (allows for one or more spaces if formatting is inconsistent).
    • 1 (N)is the current number (e.g. 1, 2, 11, etc., inserted dynamically).
    • (?!\d) is a negative lookahead that ensures the number N is not followed by another digit. This prevents partial matches like "1" within "11".
    could you please try: Set variable RegexPattern = "\\bTransaction\\s+" & %CurrentItem% & "(?!\\d)"
  • SN-09051636-0 Profile Picture
    2 on 09 May 2025 at 19:02:28
    Extracting Text from PDF and finding the Keywords
     
    Thank you for responding. Here my current item is Transaction 1, Transaction 2 etc. I have tried your solution but it is appending '& "\b  to my variable and after parsing using Parse text, its not finding the match. Here is the screenshot for the variable value.
     
                    
     
    I have a list of Transactions and for each transaction, I am extracting the pdf file pages. 
     
    Thanks!
  • stampcoin Profile Picture
    4,012 Super User 2025 Season 2 on 09 May 2025 at 18:23:11
    Extracting Text from PDF and finding the Keywords
     
    You can try this pattern ( you may want to  change it a little as your need)
     
        Set variable RegexPattern to "\bTransaction\s+" & 'CurrentItem'& "\b"
    or
        Set variable RegexPattern to "Transaction\s+" & 'CurrentItem' & "(?!\d)"
     
    good luck.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Telen Wang – Community Spotlight

We are honored to recognize Telen Wang as our August 2025 Community…

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Tomac Profile Picture

Tomac 986 Moderator

#2
stampcoin Profile Picture

stampcoin 699 Super User 2025 Season 2

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 577 Super User 2025 Season 2

Loading complete