Helpful REGEX Formulas for PowerApps

Regex, short for Regular Expression, is a powerful tool used in computer science to match and manipulate patterns in strings. It enables efficient searching, extraction, and validation of data based on specified criteria, such as email addresses or phone numbers. Though concise, mastering regex syntax is essential for utilizing its full potential in programming and text editing.

Pattern (mostly german)

What to do?ExamplePattern
eMail-Validation (exact)s.spice@contenso.com^[A-Za-z-+_]+.[A-Za-z0-9-+_]+@contenso.com$
eMail-Validation inexactsspice@any.thing.com^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+.[a-zA-Z]{2,}$
German Postal Code59559 ^d{5}$
Mobile Phone number (internationally)+0049 167876403^+\d{1,4}\s?\d{6,14}$
Employee Number (eq 5 number or more)65003^\d{5,}
Password Validation (8 or more characters)MisterGreen1&^.*(?=.{8,})(?=.*[a-zA-Z])(?=.*\d)(?=.*[!#$%&? "]).*$
InvoiceINV-249605^INV-\d{6}$
Address Validation Musterstraße 16a^[a-zA-Z\sßäöüÄÖÜ-]+(\d+[a-z]?)?$
Regex Patterns (24.07.2023)

Code

IsMatch(TextInput.Text, "%REGEXPATTERN%", %AdditionalOption%)

Replace %REGEXPATTERN% with the Pattern you need. AdditionalOptions can be viewed on the Microsoft Learn site. For example you could use MatchOptions.IgnoreCase to avoid putting in ÄÖU because you make the pattern case insensitive.

Note

Regex is valuable for pattern matching, but it alone isn’t sufficient to ensure input validity for complex data like invoice numbers or employee IDs. While regex can verify basic formats, it lacks context-specific checks. True validation requires additional logic and database queries to ensure accuracy and authenticity.

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert