Skip to main content
Skip table of contents

getPattern

Versionshinweise

26.5

Code

GROOVY
Pattern MetaDataUtils.getPattern(String fieldName)

Beschreibung

Erzeugt ein Pattern basierend auf dem Standardwert eines Feldes.

Parameter

  • fieldName – Der interne Feldname, dessen Standardwert zur Erzeugung eines Patterns verwendet wird.

Returns

Das Pattern. Gibt null zurück, wenn der Standardwert nicht automatisch generiert wird., oder das Pattern im Standardwert die PK oder VALUE Funktion verwendet.

Beispiele

GROOVY
String textWithLeadNoInbetweenChars = "your results to Lead ACLD-0000539471A";  
Serializable pattern = MetaDataUtils.getPattern("LeadNo.Lead");  
Matcher matcher = pattern.matcher(textWithLeadNoInbetweenChars);  
if(matcher.find())  
{  
  Assertions.assertEquals("LD-0000539471", matcher.group(), "found matching Lead Number despite characters around it.");  
}  
  
String textWithClearLeadNo = "your results to Lead LD-0000539471";  
List parts = StringUtils.split(textWithClearLeadNo, " ");  
for(String part : parts)  
{  
  matcher = pattern.matcher(part);  
  if(matcher.matches())  
  {  
  Assertions.assertEquals("LD-0000539471", part, "found matching Lead Number through full match.")  
  }  
}

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.