You need to sign in to do that
Don't have an account?

Regex need to match word
Actually I am trying to match merge field in string : I am trying below but not working...
string str = '{!a.d} and {!b.d} hello';
string regex = '/\\{\\!\\w+.\\w+\\.*\\}/g';
Pattern p = Pattern.compile(regex);
Matcher pm = p.matcher(str);
system.debug('----11111111111---'+ pm.find());
Any help would be appreciated
string str = '{!a.d} and {!b.d} hello';
string regex = '/\\{\\!\\w+.\\w+\\.*\\}/g';
Pattern p = Pattern.compile(regex);
Matcher pm = p.matcher(str);
system.debug('----11111111111---'+ pm.find());
Any help would be appreciated
Please try the below sample code
Naga Kiran