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 :
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,390 Super User 2025 Season 2 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,157 Most Valuable Professional on at
  • Suggested answer
    YUN ZHU Profile Picture
    95,329 Super User 2025 Season 2 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

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 > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 3,229

#2
Jainam M. Kothari Profile Picture

Jainam M. Kothari 1,867 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 1,153 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans