How to check the conformity of a string according to a pattern

By | July 27, 2018

You may come across the situation where you have to check the conformity of a string according to a pattern.

Syntax:  pat(EXPR_STR,EXPR_PAT)

  • EXPR_STR : is a string or CLOB expression that contains the string to be tested.
  • EXPR_PAT   : is a string or CLOB expression that contains the pattern used for the verification.

Example :

code_snippet

code_snippet

As seen in the above screenshot pat keyword act as filter criteria, this will fetch only those records where BPCNAM contains ‘Beverly’ in it string. Pat keyword is similar to Like keyword of SQL.

Description:

Pat allows you to verify that a string corresponds to a pattern. A pattern is a set of characters including metacharacters.

Any character that is not a metacharacter must correspond to the character found in the string. The metacharacters are the following:

  1. * represents any number of characters (possibly no character).
  2. ? represents exactly one character.
  3. # represents a digit.
  4. ! represents a letter.

Hope this helps.

About Us
Greytrix Africa is a leading Implementation, Reselling and Consulting partner for Sage Enterprise Management (Sage X3), Sage 300, Sage Enterprise Management HR (Sage X3 People) & Sage CRM based out of Nairobi, Kenya in East Africa region catering to Tanzania, Ethopia, Middle East, Australia and Asia businesses.

Greytrix Africa offers professional services such as Implementation & configuration, Business Process Analysis, Project Management, Customization, Integrations & Migrations, Technical support and Onsite resource augmentation along with enhancements within Sage Enterprise Management (Sage X3), Sage Enterprise Management HR (Sage X3 People), Sage CRM and Sage 300 (Accpac) across various industry verticals like Process Manufacturing (Food & Beverages, Chemical), Discrete manufacturing (Automotive, Textile & Apparel), Non Profit, Health-care Industry and Services Industry (Financial , Software & Engineering).

For more information on Sage Enterprise Management Consulting Services, please contact us at [email protected].We will be glad to assist you.