I have the following values for a custom picklist field
- Lower - L1
- Upper - L2
- Side - L3
What is the regex pattern to match the above values?
Mainly this pattern
{anylength of string}{one space}{one hyphen}{one space}{L charecter}{one digit integer}
I have tried something this way but not working
String message = 'Upper - L2';
String regex = '[a-zA-Z\\sL\\s\\d{1}]*';
Pattern regexPattern = Pattern.compile(regex);
Matcher regexMatcher = regexPattern.matcher(message);
if(regexMatcher.matches() == true) {
System.debug('Matched');
}