Questions tagged [pattern]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
-3
votes
1answer
60 views

Regular Expression to get Street Name and Number Separately

I am using the compile method for the pattern class in order to separate digits (street house number) from a string into a number field, and the non-digits (street) into a string field. \d* gives me ...
-1
votes
1answer
60 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 ...
-2
votes
1answer
35 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(...
2
votes
1answer
228 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: ...
1
vote
0answers
185 views

Import File Activity - File Naming Pattern / Wildcards - How far will the default go back in time?

My question is about wildcards / file name pattern inside automation studio. When you define a file name pattern inside an import file activity like FULL_IMPORT_%%Day%%%%Month%%%%Year%%.csv how will ...
0
votes
1answer
352 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 = ...
0
votes
1answer
2k views

I am writing a regular expression to get the string between the curly bracket [closed]

I am trying to get all the string from a defined text using pattern class using regex. Pattern MyPattern = Pattern.compile('/[^{\}]+(?=})/g'); but it is throwing an error Illegal string literal: ...
5
votes
2answers
3k 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 ...
1
vote
1answer
35 views

Need help with Pattern/Regular Experession [closed]

I want to check matching between string to string pattern that contain specific character as any. For example: Assume string pattern is: "TEST ***ING NUMBER *" For input: "TEST STRING NUMBER 1" ...
1
vote
1answer
1k 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 ...
1
vote
2answers
443 views

Pattern.Split doesn't behave as I've expected

Full doc on Pattern Class: Documentation Pattern Class Use case : So, whenever a Task is Created due to email to salesforce, I need to check if that emails content Body included one or more links ...
3
votes
1answer
34 views

Difficulty in using Patterns and Matchers in a single invocation

Salesforce example: Boolean Test = Pattern.matches('a*b', 'aaaaab'); I'm attempting to use regular expression on a condition to check if a string has "You Order # 1234: ", but it's always returning ...
2
votes
2answers
1k 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
2answers
406 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
1answer
104 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 ...
0
votes
2answers
725 views

Simple APEX String Replacement - can't unencode quotation marks

I've tried quite a few different methods to unencode a simple string but nothing's turning up. That's the end of my API call, using a regex solution I found online, although it's not working out. ...
3
votes
1answer
519 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
1answer
292 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
0answers
185 views

Trigger on Child record to update Parent Record and to create new Child records ( same ) [closed]

I have been trying to come up with the pattern in which i need to handle the below scenario ( considering recursion ). On Insertion of Child Record ( Object - B ) i need to update parent record ( ...
1
vote
2answers
3k 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 ...
3
votes
2answers
859 views

Using wildcard in migration tool package xml

I know how to use tags for one object example: "Account_History__c". But I am looking for a way to select all objects that start with a specific pattern. In our org we prefix all objects with the ...
4
votes
1answer
735 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 ...
1
vote
1answer
108 views

Trigger patterns

There is a pattern outlined for writing the triggers in Salesforce here : http://developer.force.com/cookbook/recipe/trigger-pattern-for-tidy-streamlined-bulkified-triggers. How Apex Trigger Pattern ...
1
vote
2answers
522 views

File Naming Pattern within import on seconds

I have a Import that uses the File Naming Pattern etsync_%%Year%%%%Month%%%%Day%%%%Hour%%%%Minute%%%%Second%%.csv and it is used in a Triggered Automation, would the Automation be fast enough to ...
2
votes
1answer
5k 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
1answer
333 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 ...