Shortcode: ^validateText()

Validates text through a regular expression and returns different messages based on whether the test succeeded or failed.

^validateText(text, regex, successMessage, failMessage)

Parameter Sample Value Description
text "123-456-6789" Required. The text you want to validate.
regex "^[0-9]{3}-[0-9]{3}-[0-9]{4}$" Optional. A regular expression test to apply to the text.
successMessage "That's a phone number!" Required. If the regex test succeeded, this message replaces the shortcode.
failMessage "That's not a valid phone number" Required. If the regex test failed, this message replaces the shortcode.

Example Usage

+ my phone number is *
- ^validateText(<star>, "^[0-9]{3}\-[0-9]{3}\-[0-9]{4}$", "Nice phone number.", "That's not a real phone number!")

Details