I want to get the sub string 'fact.cm_comp_sales_adjustment_factor__c.living_area_default_index_score__c'
in the string '[subj.cm_parcel__c.sqft__c]+[comp.cm_sale__c.sqft__c])*fact.cm_comp_sales_adjustment_factor__c.living_area_default_index_score__c]'
. But it can't return the true value. Anyone can help? Here is my code :
Pattern MyPattern = Pattern.compile('(?<=[)fact.+?(?=])');
Matcher MyMatcher = MyPattern.matcher('[subj.cm_parcel__c.sqft__c]+[comp.cm_sale__c.sqft__c])*[fact.cm_comp_sales_adjustment_factor__c.living_area_default_index_score__c]');
System.Debug(MyMatcher);
System.Debug(MyMatcher.matches());
And the return value:
When I check my regular expression on Regex 101 tool. It still returns the correct value: