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
SFDC_2706SFDC_2706 

Quick help on Regex syntax

Hi Experts
I am looking to set a Regex syntax for one of my custom field which looks like this "df976353-c0dd-448e-a989-443a4b889442".
I am using below syntax, but getting error :
!REGEX(Customer_ID__c, "\b[0-9a-f]{8}\b-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-\b[0-9a-f]{12}\b")

Any help on correcting this would be greately appreciated..!!
Thanks
Rohan
Best Answer chosen by SFDC_2706
Sai PraveenSai Praveen (Salesforce Developers) 
Hi Ronu,

Can you check if this formula works.
 
!REGEX(Customer_Id__c, "\\b[0-9a-f]{8}\\b-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-\\b[0-9a-f]{12}\\b")

If this solution helps, Please mark it as best solution.

Thanks,
 

All Answers

Sai PraveenSai Praveen (Salesforce Developers) 
Hi Ronu,

Can you check if this formula works.
 
!REGEX(Customer_Id__c, "\\b[0-9a-f]{8}\\b-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-\\b[0-9a-f]{12}\\b")

If this solution helps, Please mark it as best solution.

Thanks,
 
This was selected as the best answer
SFDC_2706SFDC_2706
Thanks buddy. It worked perfectly and I got my mistake of double //. :)