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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Regex - parsing text a...
Power Automate
Answered

Regex - parsing text after third appearance of sign "$"

(1) ShareShare
ReportReport
Posted on by 9
Hi,
 
I have a following text:
 
"$1234 $2345 $3456"
 
 
What I need is to parse a number appearing after third appearance of the sign "$", which is "3456".
 
I used regex working on regex101:
 
 
...but in PAD this one results in "0".
 
I had couple of other options. Below regexes and results in PAD:
 
^(?:[^$]*\$){3}(.*) result: "0"
(?:[^$]*\$){3}([^$]*) result: "0"
\\$(.*) result: "0"
(?<=([^$]*\$){3})\s*(.*) result: "13"
(?<=([^$]*\$){3}).* result: "13"
 
I also played around with removing white spaces in "$1234 $2345 $3456" before applying regexes.
 
Actually, I figured out, that I can simply parse three times text appearing after "$", but still, it bothers me that none of these regexes parsing text after third appearance work. Also, I don't know how big the project will be, so it would be cool to have one line of code, instead of three to have it done. 
 
Many thanks for any ideas!
I have the same question (0)
  • Suggested answer
    Deenuji_Loganathan_ Profile Picture
    6,250 Moderator on at
    Hi Pawel,
     
    I recommend using ChatGPT generate your regex for your business requirements.
     
    This solution was provided by ChatGPT and it has been working well for me.
     
    Regex: 
    \d+(?=[^$]*$)

    Flow Screenshot:

     
    Full code (Copy and paste the below code into your power automate desktop flow):
    SET StrValue TO $'''$1234 $2345 $3456'''
    Display.InputDialog Title: $'''Info''' Message: $'''Enter the data''' InputType: Display.InputType.SingleLine IsTopMost: False UserInput=> StrValue ButtonPressed=> ButtonPressed2
    Text.ParseText.RegexParseForFirstOccurrence Text: StrValue TextToFind: $'''\\d+(?=[^$]*$)''' StartingPosition: 0 IgnoreCase: True OccurrencePosition=> Position Match=> Match
    Display.ShowMessageDialog.ShowMessage Title: $'''Info''' Message: Match Icon: Display.Icon.None Buttons: Display.Buttons.OK DefaultButton: Display.DefaultButton.Button1 IsTopMost: False ButtonPressed=> ButtonPressed
    
     
    Thanks,
    Deenuji Loganathan 👩‍💻
    Power Automate Desktop Community Champion 🤖
     
  • Verified answer
    PawelSlon Profile Picture
    9 on at
     
    thanks for your answer. 
     
    I was looking for that solution using Perplexity.ai, regex101.com, as well as stackoverflow.com. Will add chat GPT to my sources:)
     
    Your solution is interesting, though it gives me result "13" in PAD. Though it works on regex101:/ Is it a PAD issue?
     
    Regards,
     
    Paweł
  • Suggested answer
    eetuRobo Profile Picture
    4,503 Super User 2026 Season 1 on at
    @PawelSlon

    I think you are looking at the wrong output variable. You are looking at the "Position" which just returns the position which the text is found. Look at the Match variables value and it should be same as in Deenuji_Loganathans, picture: 3456


    ps. I think you should mark Deenujis answer as the solution

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 573

#2
Valantis Profile Picture

Valantis 407

#3
11manish Profile Picture

11manish 387

Last 30 days Overall leaderboard