Method RegEx():createEmail() Foundation
Creates a RegEx instance for email address validation.
:createEmail( [<lStrict>] ) --> oRegEx
The pre-configured RegEx object.
Factory method that creates a pre-configured RegEx object for validating email addresses. Provides different validation modes which allow to specify a bias towards practical/hands-on or technical validation.
General email validation
oEmail := RegEx():createEmail()
? oEmail:test("user@example.com") // .T.
oEmail:destroy()
Strict (RFC 5322) email validation
oRegEx := RegEx():createEmail( .T. )
? oRegEx:test( "user+name!foo%bar@[192.168.1.42]" ) // .T.
? oRegEx:test( '"john\"doe"@example.com' ) // .T.
oRegEx:destroy()
If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.