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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Extracting Text from P...
Power Automate
Unanswered

Extracting Text from PDF and finding the Keywords

(1) ShareShare
ReportReport
Posted on by 9
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!
I have the same question (0)
  • stampcoin Profile Picture
    5,058 Super User 2025 Season 2 on at
     
    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.
  • SN-09051636-0 Profile Picture
    9 on at
     
    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
    5,058 Super User 2025 Season 2 on at
    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)"

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 501 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 323 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard