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 / How to replace numeric...
Power Automate
Answered

How to replace numeric part of file name using regex

(1) ShareShare
ReportReport
Posted on by 33

I would gladly appreciate if someone could help me using regex correctly in power automate desktop.

 

I'm using the replace File Name function with  ([0-9]+) regular expression. I have also tried \d+ and [0-9]+ but it does not seem to work. I don't know if regex syntax in power automate is used differently.

 

My objective is to:

file_name_9875234.csv ----> file_name_%currentDate%.csv

  • Verified answer
    UshaJyothiKasibhotla Profile Picture
    229 Moderator on at

    HI @franco2 

     

    Please try as shown below image

    UshaJyothi20_0-1707411447878.png

    It worked for me if you have any doubt please let me know

     the code is below please paste into your PAD Designer 

    SET STR TO $'''file_name_9875234.csv'''
    DateTime.GetCurrentDateTime.Local DateTimeFormat: DateTime.DateTimeFormat.DateOnly CurrentDateTime=> CurrentDateTime
    Text.Replace Text: STR TextToFind: $'''\\d+''' IsRegEx: True IgnoreCase: False ReplaceWith: CurrentDateTime ActivateEscapeSequences: False Result=> Replaced

     

     

    Hope this helps,

    Usha.

  • franco2 Profile Picture
    33 on at

    Thank you! it did work, now I'm gonna modify my code to integrate the solution.

  • UshaJyothiKasibhotla Profile Picture
    229 Moderator on at

    If it works please mark it as a solution to close the loop

  • franco2 Profile Picture
    33 on at

    Sorry, new to this.

    Thank you

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
Mohsin Ali Profile Picture

Mohsin Ali 445

#2
11manish Profile Picture

11manish 345 Super User 2026 Season 2

#3
M Bilal Khan Profile Picture

M Bilal Khan 300

Last 30 days Overall leaderboard