Regular Expressions 101

Community Patterns

1...45678...640

Simple Address Validation

0

Regular Expression
ECMAScript (JavaScript)

/
^(?![ -.&,_'":?!/])(?!.*[- &_'":]$)(?!.*[-.#@&,:?!/]{2})[a-zA-Z0-9- .#@&,_'":.?!/]+$
/

Description

This tries to validate the address in English-compliant formats.

Note: Not tested for script languages Arabic.

const regExp = /^(?![ -.&,_'":?!/])(?!.*[- &_'":]$)(?!.*[-.#@&,:?!/]{2})[a-zA-Z0-9- .#@&,_'":.?!/]+$/;
Submitted by Sowed Castelli - 2 years ago