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 / Parse text RegEx Issue
Power Automate
Answered

Parse text RegEx Issue

(0) ShareShare
ReportReport
Posted on by 15

Hi everyone.

 

There is an error in "Parse Text" block.

I was testing this block and get some problem on "Positions" output when I test it with multiple matches option.

I test it with a regular expression to get no matches and get "Positions = -1", but this variable output is empty (Positions = [] ).

Desktop. version 2.34.181.23193. Spanish language.

===Data input ===

Text Input:

B:\Users\siNaBEC\ <--- with a blank space at end of string to get NO Match
C:\Users\SiNaBEC
D:\Users\sinabec\
A:\Users\siNaBEC\
just another text

 

RegEx Code (to get No Matches)

.*\\xxx[\t\n\r\f\v]*(?=\n|$)   <---Delete "xxx" to get 2 matches "D:\ and A:\ lines"

 

Input Position = 0

Only first match = False <--- Because I'm testing multiple matches

Insensitive Text = True

 

=== OUTPUTS ===

Matches = [] <---This is OK

Positions = [] <---THIS IS NOT OK, I expect a -1 value.

 

Does somebody has the Parse Text block issue... or it's my software version????

 

image.png
image.png
I have the same question (0)
  • Verified answer
    Agnius Bartninkas Profile Picture
    Most Valuable Professional on at

    When you use Parse text to return all matches and not just the first one, it generates an array instead of a single value. So, both %Positions% and %Matches% are arrays. And if there are no matches, instead of returning -1, it will return an empty array. This is the normal behavior of the action.

    If you want to control for no matches, instead of checking if %Positions% equals to -1, check if it is empty or if %Positions.Count% equals 0. Both of these approaches will tell you Parse text returned no matches. Honestly, you can do the same with %Matches%, too. No need to use %Positions% at all here.

    -------------------------------------------------------------------------
    If I have answered your question, please mark it as the preferred solution. If you like my response, please give it a Thumbs Up.

    I also provide paid consultancy and development services using Power Automate. If you're interested, DM me and we can discuss it.

  • Zicco Profile Picture
    15 on at

    Hi... and sorry, I was on vacations trip.

    I understand "Positions" is an array, but documentation says something different. So, I was at least expecting an array with one element and a value of "-1"...or something like that.

    image.png
  • Agnius Bartninkas Profile Picture
    Most Valuable Professional on at

    Well, it seems like the documentation is a bit outdated. Not really surprising, to be honest.

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 Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Valantis Profile Picture

Valantis 419

#2
Vish WR Profile Picture

Vish WR 314

#3
David_MA Profile Picture

David_MA 260 Super User 2026 Season 1

Last 30 days Overall leaderboard