AX 는. Net 의 Regular Expression 을 사용 합 니 다.

AX 자 체 는 regular expression 을 지원 하지 않 지만. Net 의 Regular Expression 을 사용 할 수 있 습 니 다.
링크 는 좋 은 demo 입 니 다.http://fourone.se/blog/2009/10/02/using-regular-expressions-in-dynamics-ax/
링크 는 Regular Expression 문법 입 니 다.https://dotblogs.com.tw/johnny/archive/2010/01/25/13301.aspx 코드 는 다음 과 같 습 니 다:
Static Server boolean validateEmail(EMail   _eMail)
{
    Str MatchEmailPattern =
    @"^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$";
    System.Text.RegularExpressions.Match myMatch;
    ;
 
    myMatch = System.Text.RegularExpressions.Regex::Match(
    _eMail, MatchEmailPattern);
    return(myMatch.get_Success());
}
static void Job1(Args _args)
{
    Str EmailPattern =
    @"\b[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}\b";
    Str ReplacedText;
    ;
 
    ReplacedText =
    System.Text.RegularExpressions.Regex::Replace(
    "My email address is: [email protected]",
    MatchEmailPattern,"[email protected]");
 
    print ReplacedText;
    pause;
 
}
static void Job6(Args _args)
{
    Str MatchEmailPattern =
    @"\b[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}\b";
    System.Text.RegularExpressions.Match myMatch;
    ;
 
    myMatch = System.Text.RegularExpressions.Regex::Match(
    "Your email: [email protected], and my"
    +"email: [email protected]", MatchEmailPattern);
 
    while (myMatch.get_Success())
    {
        print myMatch.get_Value();
        myMatch = myMatch.NextMatch();
    }
 
    pause;
}

좋은 웹페이지 즐겨찾기