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 :
Microsoft Dynamics AX (Archived)

matching string into some format

(0) ShareShare
ReportReport
Posted on by

Hello!

Is there any way to check if string suits to some format, eg: "a0 - b1", where "a" and "b" can be any letter, "0" and "1" can be any number.

I know It can be done by lots of if's but I'm sure there is simpler way to do that.

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Martin Dráb Profile Picture
    239,029 Most Valuable Professional on at

    Use the match() function.

  • Community Member Profile Picture
    on at

    How could I miss it!? I thought I have seen all functions connected with string type.

    Thanks a lot!

  • Community Member Profile Picture
    on at

    I still have problem because there is "-" in my pattern, what is a one of special characters.

    I wrote job to test and I always get "not found" info.

     if(match(":a:d-:a:d","r4-b2")  )

       info("found!");

       else

           info("not found");

  • Verified answer
    Martin Dráb Profile Picture
    239,029 Most Valuable Professional on at

    It's an operator (matches for zero or one occurence); if you want to use as a value, you have to escape it (\-).

  • Community Member Profile Picture
    on at

    static void Job45(Args _args)

    {

       if(match(":a:d\-:a:d","r4-b2"))

       info("found!");

       else

           info("not found");

    }

    Still nothing.

  • Community Member Profile Picture
    on at

    "\\-" worked. Thanks again, without you I would type lots of if's.

  • Verified answer
    Martin Dráb Profile Picture
    239,029 Most Valuable Professional on at

    Try also @":a:d\-:a:d".

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!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Joris dG Profile Picture

Joris dG 5

#2
Alexey Lekanov Profile Picture

Alexey Lekanov 2

#2
Henrik Nordlöf Profile Picture

Henrik Nordlöf 2 User Group Leader

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans