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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Suggested Answer

Extracting groups with Regex pattern

(2) ShareShare
ReportReport
Posted on by 55
Greetings,
 
I'm trying to figure out how Regex codeunit works in Business Central.
 
For example, lets say I have a Regex expression /(.*)/(.*)/(.*)/ and a text /Test123/Test456/Test789/.
 
How can I extract the values:
 - Test123
 - Test456
 - Test789
 
I tried using the /Regex.Match(..)/ procedure, but it only extracts the whole value /Test123/Test456/Test789/ instead of separating it:
 
 
I'm a complete beginner in using the Regex, but according to the /regex101.com/, this should work. I'm not sure what am I missing here (unfortunately, there are not many examples on how to use Regex for BC):
 
 
My guess is that I need to use /Regex.Group(....)/ method, but I didn't figure out how to do it yet.
 
Can someone please help me to achieve this?
 
Thank you.
I have the same question (0)
  • Suggested answer
    Mohamed Amine Mahmoudi Profile Picture
    26,801 Super User 2026 Season 1 on at
    Hi,
     
    In your case you must use the function split to extract the values 
    e.g.
    Values := YourText.Split('/');
    Best regards,
    Mohamed Amine MAHMOUDI
  • Gerardo Rentería García Profile Picture
    25,555 Most Valuable Professional on at
  • Suggested answer
    YUN ZHU Profile Picture
    99,086 Super User 2026 Season 1 on at
    Hi, there is a simple example about Text.Split(List of [Text]) Method in the following post, I hope it can give you some tips.
     
     
    Thanks.
    ZHU

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 1,993 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,116 Super User 2026 Season 1

#3
Khushbu Rajvi. Profile Picture

Khushbu Rajvi. 557 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans