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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Remove blank lines from multi-line field using Jason Lattimer's Regex util

(0) ShareShare
ReportReport
Posted on by

I am trying to have a workflow remove blank lines from I can't seem to get the regex replace string just right. As the top line is still a blank no matter what. Here's what I'm doing:

This is to concatenate a composite address from the various fields. And then have the regex replace remove the blank lines. When I first tried this without doing a regex blank line removal, the amount of conditional branching was tremendous, and also introduced lots more blank lines, of which I have no idea how workflow added all those blank lines

The RegEx: (^(\r\n|\n|\r)$)|(^(\r\n|\n|\r))|^[ \t\r\n]*$|^\s*$/gm

0181.regex.png

Turns into this when the workflow is complete.

1256.composite.png

*This post is locked for comments

I have the same question (0)
  • Verified answer
    a33ik Profile Picture
    84,331 Most Valuable Professional on at

    Hello,

    Try following pattern - (^\s*(\r\n|\Z))

  • gdas Profile Picture
    50,091 Moderator on at

    Hi,

    Please try with this.

    ^\s*$[\r\n]*

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans