Water 5-Common Data Types-String Regex
class pattern.quantity
Match a pattern a number of times
Contract
Parameter keyDefault valueType
a_patternreq
a_typeopt
regex_stringoptstring
min0integer
max"infinity"type.<one_of "infinity" number.integer/>
greedytrueboolean
Water Contract
<class pattern.quantity
  a_pattern     =req
  min           =0=number.integer
  max           ="infinity"=<type.one_of "infinity" number.integer/>
  greedy        =true=boolean
/>

See also: is_type_for, get_string_segments, replace_string_segments, string_segment, zero_or_one, zero_or_more, one_or_more

This class is used to specify a min and max number of times the given pattern should be repeated contiguously in the target string.

a wob
Parameter keyDefault valueType
a_patternreq
Any valid pattern. If the default values for min, max, and greedy are used, the pattern will be matched as often as it is detected.

pattern.<quantity pattern.uppercase />.
<is_type_for "xxxABCDzzz" />
true

a wob
Parameter keyDefault valueType
min0integer
Specifies the minimum number of times the pattern should be repeated contiguously.

Example: Pattern repeated contiguously 2 to 4 times
pattern.<quantity "abc" min=2 max=4 />.
<is_type_for "abcabcabc" />
true
Example: Pattern repeated contiguously less than min times
pattern.<quantity "abc" min=2 max=4 />.
<is_type_for "abcxxx" />
false

a wob
Parameter keyDefault valueType
max"infinity"type.<one_of "infinity" number.integer/>
Sets the maximum number of times a pattern may match in the target string.

Example: Has more than the maximum quantity from start to end
<pattern pattern.start_of_line
         pattern.<quantity pattern.<one_of "A" "B" "C" /> min=1 max=2 />
         pattern.end_of_line />.
<is_type_for "ACAB" />
false
a wob
max="infinity"
If max is the string "infinity", then the number of times matched is min or more. This is the default value for this field.
Example: Pattern repeats at least five times
<pattern pattern.start_of_line
         pattern.<quantity pattern.alphanumeric min=5 max="infinity" /> />.
<is_type_for "ab123!@#" />
true

a wob
Parameter keyDefault valueType
greedytrueboolean
When greedy is false, only min-max values of: 0 1, 0 "infinity", 1 "infinity" are supported