Questions tagged [regular-expressions]
A regular expression (abbreviated regex or regexp) is a sequence of characters that forms a search pattern, mainly for use in pattern matching with strings, or string matching, i.e. "find and replace"-like operations.
353 questions
0 votes
1 answer
262 views
Regular expression not matching in lightning web component
I have a lightning-record-edit-form with a lightning-input-field that is connected to a rich text field. I have the following on change handler for the field: handleBodyChange() { let target = this....
2 votes
2 answers
174 views
Find URLs in with Regex with SSJS
I am on a mission to extract URLs from all the emails unfortunately I am getting stuck on regex with SSJS. My plan is to call the Content Builder API (/asset/v1/content/assets?$filter=id=12345)for the ...
0 votes
1 answer
642 views
Validation Rule to allow numbers and blank spaces only, not longer than 20 characters
I have created following validation rule, but struggling how to add to it to also allow blank (space) values. AND(NOT(ISBLANK(field__c)), OR( LEN(field__c) > 20, NOT(REGEX(field__c,"^[0-9]+$&...
0 votes
1 answer
395 views
<lightning-formatted-rich-text> converting string to email formatting
I am currently writing a basic search users UI which can search email of users and return based on a search string and bolds the matching chars in the result. I achieve this by adding tags in JS and ...
0 votes
1 answer
331 views
Working with regex on big Strings (Avoiding Regex too complicated error) [duplicate]
Is there a way to divide/simplify a pattern match to avoid getting this error ? Sometimes the Json String that I'm trying to match is way too long and it causes errors on a batch a class. I am ...
0 votes
1 answer
856 views
LWC lightning input Regex pattern not working and showing errors in console
I have been using regex pattern with 'message-when-pattern-mismatch' error message for some lightning input fields in LWC component. regex1 is like : pattern="^[A-Za-z-.' ]*" [it should ...
0 votes
0 answers
258 views
How to insert REGEX line breaks in Validation Rule
The Validation Rule listed below is supposed to fire if the below criteria is not met: For Sales Orders, enter between 6-8 digits OR For Delivery IDs, enter 10 digits. Users may enter multiple values ...
3 votes
2 answers
735 views
How to use Custom Label in REGEX function in Validation Rule
I am able to use the regex formula string directly in the validation rule and its working fine when I tested it. AND( CONTAINS(RecordType.Name, 'International_Lead'), !REGEX(Phone, '^(\\+)\\d{...
-1 votes
1 answer
665 views
Create a conditional pattern for validating phone number in Screen Flow
I am using a screen flow to capture information that will create multiple records, and one of the fields I need to capture is a Phone field. Depending on a value set previously (Country), the phone ...
0 votes
1 answer
433 views
Aura Decimal Input value to match number field limit 16,2
I am trying to limit my input number field to exactly match the field values which are 16 digits to 2 decimal digits. Also I want to prevent user from putting something different into the field like a ...
-2 votes
2 answers
109 views
Stuck with a regular expresion
I have the following in Javascript and are trying to do this in apex but having issues .replace(/\s+/g, '-') // Replace spaces with - .replace(/&/g, '-and-') // Replace & with 'and' .replace(/[...
-1 votes
2 answers
415 views
Seeking Guidance: Email Validation Error Handling for Specific Scenarios for field in account object
I'm facing an email validation challenge for my project. I want to throw an error if any of the following scenarios are met: The email has numbers at the end, like '[email protected]'. The email ...
-2 votes
1 answer
2k views
Regular expression for specific email address format in a validation rule
I have a regular expression which requires emails to be in [email protected] format. I want to tweak to be [email protected] OR [email protected] where 'i' would be ...
0 votes
1 answer
312 views
Validation rule to prevent more than a certain number of one character in a text field
Is it possible to include in a validation rule for a text field to only allow X amount of commas? I am trying to limit the amount of emails that are currently seperated by a comma.
0 votes
1 answer
183 views
Replacing specific text in Case field
I'm looking to basically redact some information in our Salesforce environment, across various fields and using different REGEX patterns. For example, in Case.Description, I have the following details:...