Activity Forums Salesforce® Discussions How to read text between tags in Salesforce?

  • madhulika shah

    Member
    August 29, 2018 at 5:37 AM

    Hi Chanchal,

    You have to use Java regex to extract text between tags. Code snippet for the following is:

    final Pattern pattern = Pattern.compile("<tag>(.+?)</tag>");
    final Matcher matcher = pattern.matcher("<tag>String I want to extract</tag>");
    matcher.find();
    System.out.println(matcher.group(1)); // Prints String I want to extract

Log In to reply.

Popular Salesforce Blogs

How Salesforce Boosted the Reach of MrBeast’s $1M Puzzle

Blog in

Salesforce partnered with YouTuber MrBeast for a groundbreaking Super Bowl campaign that turned a traditional ad into an interactive $1 million puzzle hunt, massively amplifying…

Popular Salesforce Videos