Skip to content

Optional substring in steps #1099

Closed Answered by jenisys
lu-maca asked this question in Q&A
Apr 6, 2023 · 1 comments · 1 reply
Discussion options

You must be logged in to vote

You can use optional types by using special registered types (simplified by using the parse_type module).

NOTES:

  • Your example: If you do not specify a type in a parse-expression, the corresponding regular-expression is normally greedy and will match as much as possible.
  • The simplest solution is normally the cardinality-fields expression, like: {number:Number?} for an optional number using the cfparse matcher. It automatically implicitly generates patterns for other cardinalities by using the registered types/patterns with cardinality=1.

SEE:

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@lu-maca
Comment options

Answer selected by jenisys
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants