function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
ALI 15ALI 15 

Validation for lightning:input Regex for apostrophe With only D,L and O characters


I need a validation for Apostrophe usage is to the letters D, L, and O. (e.g., O’Brien, D'Artagnan...)
I am using pattern="[ A-Za-z-_’]*"
Dhanya NDhanya N
Hi Ali,

Try using escape character something like \'
Reference: https://salesforce.stackexchange.com/questions/196769/regex-help-escaping-characters-and-matcher-method

Thanks,
Dhanya