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
Sahil YadavSahil Yadav 

Hello Mates I wanted your help on writing the Regular Expression.


Custumer Name:Abc Xyz
here i wanted basically to write the regex for validating the first name and last name 
Regex ('[Custumer Name]+[A-Za-z]+[]+[A-Za-z]+')
Here basically i wanted to know as there is a space in between of first name and lastname so how we can write the regex expression for space ?
AnkaiahAnkaiah (Salesforce Developers) 
Hi Sahil,

try with below 
 
NOT(REGEX(Custumer_Name__c ,"([a-zA-Z ])*"))
If this helps, Please mark it as best answer.

Thanks!!
 
Sahil YadavSahil Yadav
Hello Ankaiah,
Could you please share your point of views
('[Custumer Name]+[A-Za-z ]+[A-Za-z]+') is it correct?
 
AnkaiahAnkaiah (Salesforce Developers) 
Hi Sahil,

Your requirment is to allow only space in the Custumer Name field right?



 
Sahil YadavSahil Yadav
Hello Ankaiah ,

There is dicription field in case obj where it contains Customer Name: Smith Ng Customer Email: smith.ng@.com
now my task is basically to get the get the name from the description field and populate to some other field in case obj
Just name that is Smith Ng 
any suggestions !!!!
caserec is one of the case record
String casedesc = caserec.Description;
String SuppliedName = casedesc.substringAfter('Name:');
System.debug('@@'+SuppliedName);
String sn = SuppliedName.substringBefore(' Custumer Email:');
System.debug('@@'+sn);
//caserec.SuppliedName = SuppliedName;
AnkaiahAnkaiah (Salesforce Developers) 
Hi Sahil,

Similar kind of solution provided in the below link.

https://salesforce.stackexchange.com/questions/186625/copy-values-from-case-description-field-to-custom-fields-on-case

Please let me know if any help required.

Thanks!!