Water 5-Common Data Types-String Regex
class pattern.zero_or_one
Match a pattern zero or one times
Contract
Parameter keyDefault valueType
a_patternreq
a_typeopt
regex_stringoptstring
greedyfalseboolean
Water Contract
<class pattern.zero_or_one
  a_pattern     =req
  greedy        =false=boolean
/>

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

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

a wob
Parameter keyDefault valueType
a_patternreq
Any valid pattern. The pattern will match zero or one times.

<pattern "xxx"
         pattern.<zero_or_one pattern.uppercase />
         "zzz" />.
<is_type_for "xxxAzzz" />
true
<pattern "xxx"
         pattern.<zero_or_one pattern.uppercase />
         "zzz" />.
<is_type_for "xxxzzz" />
true