Skip to main content
Community site session details

Community site session details

Session Id : +PTUOcbBp8bln6l7eXo4/u
Power Apps - Building Power Apps
Unanswered

Text.Label - How to remove all characters between curly brackets? - MatchAll and substitute/replace

Like (0) ShareShare
ReportReport
Posted on 22 Oct 2022 17:16:47 by

Hi all

I've got a label getting text from gallery.issue_descriptiontext and I would like to replace * and all text between curly brackets, and include curly brackets, with blank.

this is an example of the text :

*instructions:
* Enter with appID on  system Ocn page 
* Expand system Ocn 1

{color:#00875a}* Result:* 434113{color}
Expand system Ocn 32

{color:#de350b}* Result:* 432323{color}
Expand system Ocn 43
 access denied red banner

*Note:*

 
Can someone please show me how to do this with matchAll regex and Sub or another way?

Thanks
Melkor

 



 
  • TheRobRush Profile Picture
    11,121 Moderator on 22 Oct 2022 at 22:05:54
    Re: Text.Label - How to remove all characters between curly brackets? - MatchAll and substitute/replace

    Ok so, unfortunately I can't get this all done in a single textbox or label, it's a bit past where I am at currently.

     

    HOWEVER I can get this done as an action. I placed the text to look at in a label (Label2) but can look at it anywhere.

     

    All this code I place in a button

     

    ClearCollect(ogData,Label2.Text);
    ClearCollect(theMatches,
    DropColumns(
    MatchAll(
     Label2.Text,
     "\{"&MultipleNonSpaces&"\}")
    ,"SubMatches", "StartMatch"));
    ForAll(Sequence(CountRows(theMatches)),
     Patch(ogData,First(ogData),{Value:Substitute(First(ogData).Value,Last(FirstN(theMatches,ThisRecord.Value)).FullMatch,"")}))

     

    It goes through and finds every time { } occurs, stores them, then goes back through and changes original info

     

    so if you execute that on say the button that loads each item, it would work and then you just display

     

    First(ogData).Value

     

    instead of the data directly.

     

    If there is a way to do this all in just a single text display control someone like @RandyHayes would probably know

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

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 791 Most Valuable Professional

#2
MS.Ragavendar Profile Picture

MS.Ragavendar 410 Super User 2025 Season 2

#3
mmbr1606 Profile Picture

mmbr1606 275 Super User 2025 Season 2