Questions tagged [matcher]
The matcher tag has no usage guidance.
35
questions
-1
votes
1
answer
19
views
Is there any way to setup match score field in salesforce
I need to set up a match score between the email and web domain at the lead level.
Is there any way to set up a formula field at the lead level?
For Reference:
0
votes
2
answers
76
views
Regex not working in class but works in execute anonymous
You can get some context here on my previous post.
When I run the below code on execute anonymous, it renders the following result:
String txt = 'Requesting service for Id Number 9202204720082, Case C ...
0
votes
1
answer
95
views
Regex for Case Number, South African Id and Passport
Please bear with me, I'm not well versed with Pattern, Matcher or Regex.
I found the below on https://regex101.com/
South African passport: [A|D|M|T][0-9]{8}
South African Id: (([0-9]{2})(0|1)([0-9])(...
0
votes
1
answer
190
views
Pattern Matcher problem
I want to get the sub string 'fact.cm_comp_sales_adjustment_factor__c.living_area_default_index_score__c' in the string '[subj.cm_parcel__c.sqft__c]+[comp.cm_sale__c.sqft__c])*fact....
1
vote
0
answers
372
views
Replace whitespace in part of a string
I have cases which contain urls in the case description, and the urls contain whitespace. I need to replace the whitespace with %20 in order to make the links clickable from the case. Obviously the ...
1
vote
2
answers
821
views
Existing Account not matching during Lead conversion process
I'm having an issue with existing account matching during the Lead conversion process.
In this example, I am using the Standard Lead Duplicate Rule; with a custom account matching rule with the ...
0
votes
1
answer
262
views
Matcher.matches() is not working as expected
I am trying to match DateTime input using the Pattern and Matcher class of Apex but wasn't able to achieve it.
I've created a regex for matching the Datetime input as follows and it matches the ...
0
votes
1
answer
711
views
Not able to remove substring that is variable from a string
I want to remove everything except for Name. removeStart() and remove() don't seem to take variable as a parameter.
String tmpField = '{!Contract.Name}';
String child = 'Contract';
tmpField = ...
1
vote
1
answer
134
views
Having problem with apex regex
I need to find credit card numbers in a chat transcript inside its before insert trigger and x them out. I have the following regex(s) first one works in online tools for long strings containing new ...
0
votes
2
answers
190
views
Find all non-alpha characters in string (excluding special alpha chars) and capitalise each word before/after the character
I'm looking to capitalise each part of a string that precedes/follows a special character and found this post which does the trick nicely. Only problem is it also sees characters which are special ...
0
votes
1
answer
905
views
Regular expression is not working as expected in apex
I'm working on design patterns while I'm testing in the anonymous window it's working as expected. But when i trying to implement the same logic it's unable to find matches
My expression:'^([0-9])\\1*$...
1
vote
2
answers
1k
views
Regex matching multiple words from the LIST [closed]
Writing Regex that matches the set item list? for an example, write regex that matches whatever is in the targetValues ?
Apex code:
String result = 'favorable day can one introduced two sentiments ...
5
votes
1
answer
3k
views
Why are my matchers not working after adding an overloaded method?
To help getting past our permission checks during unit tests to test actual functionality, I created a mocking class so people could just call the mocking method they needed from that class for the ...
-1
votes
1
answer
281
views
Regex in Pattern.compile to split BillingStreet into custom street and house number field
I want to split BillingStreet into a custom Street__c and HouseNumber__c. According to what I have read so far online, I need to:
Instantiate a new Pattern object
//Pattern 'Test Street 123' OR '123 ...
-1
votes
1
answer
7k
views
Is it possible to do a "reverse regex" pattern match?
I have the following code:
if(PATTERN_A.matcher(someValue).matches()){
model = MODEL_A;
} else if(PATTERN_B.matcher(someValue).matches()){
model = MODEL_B;
} else if(PATTERN_C.matcher(...
1
vote
1
answer
47
views
Cannot Find Duplicate Management in Lightning
I am having difficulty managing matching rules in SF Lightning because I cannot get past step one of all the guides I have found. When I type "match" or "dup" into the quick find box, nothing comes up....
3
votes
1
answer
1k
views
Regex having issues in Apex
I found a Regex which retrieves the Parent domain from a URL. When I tried using the same Regex Expression in Apex using Pattern and Matcher, it's giving me an error of:
Illegal string literal: ...
0
votes
0
answers
860
views
Cross Field Matching Rule - Duplicate Rules
On Contact record we have two email fields - Email and Personal_Email__c. We want to identify records as matches if any of the email address fields match any existing email addresses in those fields ...
0
votes
1
answer
2k
views
patern and matcher not working
I am using regex to find line which starts with 'aaaa'
pattern myPattern = pattern.compile('^(aaaa)\b.*');
String a = 'aaaa,777,ttttt,rrrrrr';
a += '\n' + 'tttttt,ttttt,0000';
matcher myMatcher = ...
8
votes
2
answers
9k
views
Regex Help- Escaping Characters And Matcher Method
I have a string:
allPunctuation = '~!@#$%^*()_+|}{":?><`=;/.,][-\'\\';
This string contains APEX's way of escaping characters so I can include the ' and the \ characters.
When I pass this ...
0
votes
1
answer
4k
views
Duplicate Rule Issue when differentiating Record Types
We have a Custom Object 'Target' In our application.It has total 5 record types and each record type has respective duplicate rule.
The purpose of the the custom object is to set the target for ...
1
vote
1
answer
4k
views
Find a Particular Substring using Regex
I am trying my hands on Email Services, am stuck at a place where I need to create a regex.
I want to find all substring which looks like "PIKA-170510-115943".
Here is my code.
String str='Strating ...
2
votes
1
answer
1k
views
How to query or report on Duplicates Match
I am using Duplicate Management; Matching Rules; Duplicate Rules from Salesforce, standard out of the box. This helps a lot to stop the bleeding and limit the manual duplicate generation. I notice ...
0
votes
2
answers
5k
views
Regex - matching only a single character
I need to find a match over the following text and I need to detect only one single under score by using REGEX:
Text: network_ip__c
Result: true
Text: Opportunity__c
Result: false
How can I ...
2
votes
2
answers
3k
views
regular expression problem (Pattern/Matcher)
I need to find specific word on a string using regular expression.
rules :
before that word, I must not have a letter, a number or an underscore.
this word must be not followed by a letter, a number ...
5
votes
2
answers
1k
views
Find if a word from a list exist in a string
I am trying to find if a sentence contains at least 1 word from a different list of words.
I am able to do this like below code, however my concern goes that the "theSentence" is a string that is ...
0
votes
1
answer
233
views
How to filter out LF and CR from values in the cells of CSV file
We have an email service which accepts CSV attachment and has process its values and insert it into the objects. CsvReader class stop processing lines from CSV when there is "Line Feed" present inside ...
5
votes
2
answers
1k
views
Apex regex and non-capturing groups
I have a regular expression that I want to use to pull ID's out of a JSON string. The expression itself appears to work fine based on the data I've given it, so that's good.
^(?:.*)(?:{"id":)(\d+)(?:...
3
votes
1
answer
1k
views
Regex Pattern to Isolate Multiple Double Quoted Terms
The pattern below allows me to isolate a single term that is enclosed in double quotes. However i'd like to be able to isolate multiple terms that are double quoted and separate them if possible.
...
1
vote
1
answer
555
views
How to split String Using REGEXP or Using Pattern class
This is My String
14-Mar-16,RTRDTG78BGXPBE3H,D-Link DIR-600M Wireless N150 Home Router,10-Apr-16, SECEBH7HZMKZMG3B,Kaspersky Internet Security 2016 1 PC 1 Year
I want to split this string Where ever ...
1
vote
2
answers
8k
views
Apex regex to get html child tag and its content? [closed]
I have below HTML tag and i need to extract TAG child tag and its element.
<h3 class="large lheight20 margintop10">
<a href="https://google.com" class="marginright5 link linkWithHash ...
5
votes
1
answer
1k
views
Regex: Make Dot Match Newline?
I use Rubular to test my regular expressions, when I need them. I am having a bit of trouble crafting an expression that will work for me. For reference, I am trying to match multiple substrings in ...
2
votes
1
answer
929
views
Regex Match Count and Scan
Is there a way that I could print the contents of each regex match within a loop? Say I have the following pattern:
1xxxx2xxxx3
If I have a matcher that is (?mi)(\d)...How could I iterate through ...
2
votes
1
answer
20k
views
Regular Expression for words with spaces
I want to check for the following strings using regExpression:
1) Main-xxxxx-Accepted
2) Main-xxx xxx-Accepted
I used the below
String regEx = 'Main-[aA-zZ-]*-Accepted';
Pattern.matches(regEx,'...
1
vote
1
answer
512
views
Regex Pattern/Matcher optional html attributes
So I am trying to make a pattern matcher that would read a block of html and identify the labels and ids of certain fields on the page. I am trying to find a way to read the label tag and parse ...