pwMatch


 [match, validPattern] = pwMatch(ID, simplePattern)

 Returns true if the given ID is matched by the provided simple PottersWheel pattern.
 This function can be used to test custom simple patterns.

 Also returned is the valid regular expression corresponding to
 the simple pattern.

 

Examples

 pwMatch('R_o',   'R_@')   % true
 pwMatch('R_o',   'R_#')   % false
 pwMatch('R_L_o', 'R_@_o') % true
 pwMatch('R_E_o', 'R_#_o') % true
 pwMatch('R_L_o', 'R_#_o') % true
 pwMatch('R_L_o', 'R_o_o') % false
 pwMatch('pA',    '<@A|A_@>')  % true
 pwMatch('pA_P',  '<@A|@A_#>') % true
 pwMatch('pA_o',  '<@A|@A_#>') % false

See also

pwTutorial_Rule_based_modeling
pwSimpleToValidRegExp
pwRegexpRep
pwRegexpRepTester