I've got this line of code:
Pattern pattern = Pattern.compile('(?:([\\w&&[^_]]+)|.)+');
However, I'm getting this error in the Developer Console:
Variable pattern is used before it is declared
What am I doing wrong?
Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It only takes a minute to sign up.Sign up to join this community
Apex is trying to use the variable you are declaring instead of referencing the class. To Apex,
Pattern are the same thing, and at the moment
pattern is closest in scope. Try renaming it to
patternA or whatever makes most sense for your code.