Scripting Guide > Types of Data > Pattern Matching > Patterns and Case Matching
发布日期: 09/18/2023

Patterns and Case Matching

Unlike regular expressions, pattern matching is case insensitive. To force case sensitivity, you can add the named argument MATCHCASE to either Pat Match() or Regex Match(). For example:

string = "abcABC";
 
result = Regex Match( string, Pat Regex( "[aBc]+" ) );
Show( string, result );

/ *returns string = "abcABC"

result = {"abcABC"}*/

result = Regex Match( string, Pat Regex( "[cba]+" ), NULL, MATCHCASE );
Show( string, result );

/* returns string = "abcABC"

result = {"abc"}*/

需要更多信息?有问题?从 JMP 用户社区得到解答 (community.jmp.com).