7-digit Club Membership ID

Data Type Requirements

  1. Search for club membership ID which consists of seven consecutive ASCII digits.
  2. No restrictions on the first and last digit of the club membership ID.
  3. Club membership ID must not be contained within a string of alphanumeric characters. No other restrictions on pattern boundaries.
  4. Case-insensitive words that can commonly be found before a club membership ID:
    • club id, member, membership

7-digit club membership ID example requirements

Go through the detailed steps to build out the custom GLASS data type (recommended), or jump straight to the recommended GLASS solution.

Part 1 - Base Pattern for 7 Consecutive Digits

In Part 1, we start by defining the most basic requirement of the club membership ID - a string of seven (TIMES 7) consecutive ASCII digits (RANGE DIGIT).

RANGE DIGIT TIMES 7

See RANGE and Preset Keywords for more information.

Part 2 - Boundary Rules

Based on Requirement #3, the club membership ID must not be contained within a string of alphanumeric characters. This means the pattern boundaries on either side of a club membership ID can be any character other than ASCII alphabets or numbers (BOUND NONALNUM).

(RANGE DIGIT TIMES 7) BOUND NONALNUM

See BOUND and Preset Keywords for more information.

Part 3 - Namespace for Contextual Keywords

In Part 3, we create a namespace (MAP NOCASE 'CLUB_MEMBERSHIP_ID_CONTEXTS') containing all the (case-insensitive) keywords that are commonly found before a club membership ID as listed in Requirement #4.

MAP NOCASE 'CLUB_MEMBERSHIP_ID_CONTEXTS' 'id', 'member', 'membership'

(RANGE DIGIT TIMES 7) BOUND NONALNUM

Part 4 - Declaring a Context Space

In Part 4, we declare (CONTEXT 'CLUB_MEMBERSHIP_ID_CONTEXT') and apply (APPLY 'CLUB_MEMBERSHIP_ID_CONTEXT') a context rule that requires (REQUIRE 'CLUB_MEMBERSHIP_ID_CONTEXTS') the contextual keywords (defined in Part 3) to be present before (BEFORE) a potential match for it to be reported.

MAP NOCASE 'CLUB_MEMBERSHIP_ID_CONTEXTS' 'club id', 'member', 'membership'
CONTEXT 'CLUB_MEMBERSHIP_ID_CONTEXT' BEFORE REQUIRE 'CLUB_MEMBERSHIP_ID_CONTEXTS'

((RANGE DIGIT TIMES 7) BOUND NONALNUM) APPLY 'CLUB_MEMBERSHIP_ID_CONTEXT'

See MAP, CONTEXT and APPLY, REQUIRE, RANGE, Preset Keywords, BOUND, and Grouping Operator for more information.

Match Samples

Based on the GLASS expression in Part 4 - Declaring a Context Space, the 7-digit strings underlined in line 1 and line 2 will be returned as matches by the GLASS pattern matching engine as they fulfill the boundary and context rules.

1
2
3
4
...My _membership_ number is 2210456...
_Club ID_: 5131789
The quick brown fox jumped over a lazy sleeping dog.
29DF1440AA2BF58CA41AC0A4244B232210456215

The 7-digit string in line 4 will not be marked as a match as it fails the BOUND rule and no contextual keywords are found within 64-bytes before the potential match.