isMatch implicitly adds ^ in front of your regex and $ at the end. So don’t include them since this would result in a regex like ^^[A-Z]$$ thus not finding anything. And [A-Z] always results in false since is does not include @ nore .
Search on [a-zA-Z]*@*.*
Or for a more extensive test: isMatch($mail, ‘[a-z0-9!#$%&''*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&''*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?’)
Or try isMatch at mymendixdemo100-sandbox.mxapps.io
The CommunityCommons module also contains the Rule EmailAddressRegex which you can use as a not too restrictive regex.
Hi Norbert,
When checking e-mail addresses using regex I always like to keep it simple, as you need a very complex one to properly validate all valid e-mail addresss, which can get pretty complex. The following regex simply checks for the string to adhere to the following structure: (some text but no ‘@’) + @ + (some text but no ‘@’) + . + (some text but no ‘@’)
isMatch($YourObject/emailAddress, '^[^@]+@[^@]+\.[^@]+$')
If your question was not so much e-mail related but more regex related then just ignore my comment :)
EDIT: ah I didn’t notice your ‘Capital’ requirement, my bad