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 / Split A String Every T...
Power Automate
Unanswered

Split A String Every Time a Capital Letter is Present

(0) ShareShare
ReportReport
Posted on by 36

I'm attempting to split a string before each capital letter present in the string, but cannot identify the error in my expression that is leading me to have no success. Currently the split expression is simply returning the unsplit input as an unchanged output.

 

Full Flow

 

1. Manually triggering the flow by inputting a Feature number from Azure DevOps.

JoeHrabnicky_0-1696438803933.png

2. Getting work item details based on the input of the manual trigger.

JoeHrabnicky_1-1696438915140.png

3. Composing an object using the Title of the work item.

JoeHrabnicky_2-1696439012078.png

4. Trimming unwanted portions of the title (ex. Title is "E-Email-CompanyName-ProjectName-P2049284" and result after trim is just "ProjectName")

JoeHrabnicky_3-1696439152236.png

 

trim(split(outputs('Compose'),'-')[3])

 

5. Initializing a string variable with the output of the previous step

JoeHrabnicky_4-1696439214689.png

6. [this isn't working] Splitting the string variable before each capital letter present within the string.

JoeHrabnicky_5-1696439294494.png

 

split(replace(variables('ProjectNameNoSpaces'), '(?=[A-Z])', ' '), ' ')

 

 

Examples of Desired Result

 

InputDesired Output
ProjectNameNoSpacesProject Name No Spaces
ThisIsJustATestThis Is Just A Test
AaBbCcDdAa Bb Cc Dd
Categories:
I have the same question (0)
  • Michael E. Gernaey Profile Picture
    53,335 Super User 2025 Season 2 on at

    Hi @JoeHrabnicky 

     

    If the string has no spaces why do you have the replace, it seems to me your split and your replace are input backwards so your splitting on ‘ ‘ and not the regular expression you mean too and your replacing your regular expression. 


    Cheers
    If you like my answer, please Mark it as Resolved, and give it a thumbs up, so it can help others
    Thank You
    Michael Gernaey MCT | MCSE | MCP | Self-Contractor| Ex-Microsoft
    https://gernaeysoftware.com
    LinkedIn: https://www.linkedin.com/in/michaelgernaey

  • takolota1 Profile Picture
    4,974 Moderator on at

      @JoeHrabnicky 

    There is no regex in Power Automate without premium / custom connectors or maybe a run script action, so this won’t work

    split(replace(variables('ProjectNameNoSpaces'), '(?=[A-Z])', ' '), ' ')

     

    Instead I suggest replacing each capital letter in the alphabet with a delimiter followed by that letter like ~A ~B ~C

    That way you can then split on the ~ delimiter you added.

  • JoeHrabnicky Profile Picture
    36 on at

    @takolota thanks for that info! To be fully transparent, I'm very new to writing expressions in Power Automate and ChatGPT actually wrote that one for me. Could you explain further what you mean with the use of a delimiter or provide illustration of what you mean?

  • Verified answer
    takolota1 Profile Picture
    4,974 Moderator on at
    split(....replace(replace(replace(variables('ProjectNameNoSpaces'), 'A', '~A'), 'B', '~B'), 'C', '~C'), ....), '~')

     

    So you would continue that replace pattern adding a new replace( and another set of replace parameters for each letter before doing the split on the delimiter.

  • Verified answer
    JoeHrabnicky Profile Picture
    36 on at

    Thanks everyone for your help! @takolota @AlexEncodian @FLMike 

     

    I ended up going with a solution from @ekarim2020 in a different thread, which can be found here! The solution for my specific use case is his most recent post on the thread, rather than the originally marked solution.

     

    Thanks again for all of your help though, this thread has definitely expanded my knowledge of expressions in Power Automate and will be super helpful moving forward!

     

    Thanks,

    Joe

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 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard