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.
  • Suggested answer
    YUN ZHU Profile Picture
    78,900 Super User 2025 Season 1 on at
    Extracting groups with Regex pattern
    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
  • gdrenteria Profile Picture
    15,506 Most Valuable Professional on at
    Extracting groups with Regex pattern
  • Suggested answer
    Mohamed Amine Mahmoudi Profile Picture
    17,181 Super User 2025 Season 1 on at
    Extracting groups with Regex pattern
    Hi,
     
    In your case you must use the function split to extract the values 
    e.g.
    Values := YourText.Split('/');
    Best regards,
    Mohamed Amine MAHMOUDI

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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,978 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,821 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156 Moderator

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans