Questions tagged [matcher]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1 vote
0 answers
32 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 ...
user avatar
  • 13
0 votes
0 answers
40 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 ...
user avatar
  • 79
0 votes
1 answer
35 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 ...
user avatar
0 votes
1 answer
158 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 = ...
user avatar
1 vote
1 answer
80 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 ...
user avatar
  • 574
0 votes
2 answers
78 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 ...
user avatar
  • 1,387
0 votes
1 answer
453 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*$...
user avatar
  • 1,420
1 vote
2 answers
888 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 ...
user avatar
  • 6,559
5 votes
1 answer
2k 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 ...
user avatar
  • 73
-1 votes
1 answer
166 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 ...
user avatar
-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(...
user avatar
1 vote
1 answer
45 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....
user avatar
  • 11
3 votes
1 answer
916 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: ...
user avatar
0 votes
0 answers
609 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 ...
user avatar
  • 13.3k
0 votes
1 answer
1k 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 = ...
user avatar
  • 3,309
8 votes
2 answers
7k 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 ...
user avatar
  • 3,167
0 votes
1 answer
3k 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 ...
user avatar
1 vote
1 answer
3k 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 ...
user avatar
2 votes
1 answer
908 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 ...
user avatar
0 votes
2 answers
3k 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 ...
user avatar
  • 1,410
2 votes
2 answers
2k 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 ...
user avatar
5 votes
2 answers
935 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 ...
user avatar
  • 1,899
0 votes
1 answer
183 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 ...
user avatar
  • 864
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+)(?:...
user avatar
  • 256
3 votes
1 answer
865 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. ...
user avatar
  • 55
1 vote
1 answer
413 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 ...
user avatar
  • 1,019
1 vote
2 answers
7k 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 ...
user avatar
  • 2,281
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 ...
user avatar
  • 142k
2 votes
1 answer
826 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 ...
user avatar
  • 1,079
2 votes
1 answer
17k 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,'...
user avatar
  • 3,954
1 vote
1 answer
448 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 ...
user avatar
  • 1,235