New answers tagged

2

A single character class isn't going to help you here, as that will simply match anything, and you specified "*", meaning zero or more, so it'll even match an empty string! You need the specific pattern to match, so: String regex = '[a-zA-Z]+ - [a-zA-Z][0-9]'; Which covers all of your examples. The spaces and hyphen can be written normally, the first part ...


1

You have tried to make the regex using a character class, but that's simply incorrect. You should find something like the following is more appropriate: ^.+ - L[0-9]$ This is: Matching the whole value (start at the beginning with "^" and end at the end with "$") Allowing any sequence of at least one character with ".+" explicitly matching space, hyphen, ...


0

Could it be that you are missing the "beginning" of the string match? (^) "^\\+[0-9 ]+((x|([Ee]xt[\\.:]?\\s?))\\d+)?$"


0

Following works fine for me var data = "ab \",\"{ cd"; var ex=new RegExp("\"","g"); console.log(data.replace(ex,"")); also Single Quote not getting replaced with Blank in lightning


1

The regex function only tells you if a regex pattern was found in the supplied string. It won't count the number of occurrences, and it won't work on a collection variable. You could use a loop on the collection variable to check each variable individually. You can then use a decision element to check if the individual variable contains the .com. This ...


Top 50 recent answers are included