Power app – Validate chuỗi thông qua regex

Power app – Validate chuỗi thông qua regex

March 30, 2021 0 By Nam Vu

Validate text input

If(
    Not(IsMatch(txtPlanningApprovalNo.Text, "[0-9A-Z]{19}-[0-9A-Z]{3}")) && !IsBlank(txtPlanningApprovalNo.Text),
    "Your input text is invalid.",
    ""
)
If(
    Not(IsMatch(txtPlanningApprovalNo.Text, "[0-9A-Z]{19}-[0-9A-Z]{3}")) && !IsBlank(txtPlanningApprovalNo.Text),
    RGBA(255, 0, 0, 1),
    RGBA(0, 18, 107, 1)
)