Operations ‣ Rules ‣ Utilities ‣ Tools ‣ extractProperty
Attempts to extract a property value from the input text. The following heuristics are used:
- It searches for the passed name (
propertyName
) followed by an “assignment character” (space, colon or equal sign). - Everything between the assignment character and an “end character” (comma, semicolon) or up to the end of the line is returned as the value of the property.
- If the property is not found,
fallback
is returned (or an empty text iffallback
is not defined.
Examples:
text = “Product properties: Color: red, Size: XL, Notes: do not spin.”
-
extractProperty(text, "size")
→ “XL” -
extractProperty(text, "Notes")
→ “Do not spin”.