发布日期: 08/07/2020

Patterns and Case

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).