You need to sign in to do that
Don't have an account?
Regex find is true but I get no results ....on timezone substring ...
I'm using substring to extract valid user timezone picklist values using below code. It does match .. but I get to results.
String text= 'Australian Central Standard Time ((South Australia) Australia/Adelaide)'; String RegEx = '(\\w+[/]\\w+[/]?\\w+)||GMT'; Pattern regexPattern = Pattern.compile(regex); Matcher mymatcher= regexPattern.matcher(text); If (myMatcher.find()){ system.debug(LoggingLevel.Info,'*** Match ' + myMatcher.group()); }What I expect in the log is Australia/Adelaide. The RegEx seems ok ... https://regexr.com/43hi9
All Answers
Your code is correct. Just select the first group like below.