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

  • madhulika shah

    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>");
    System.out.println(; // Prints String I want to extract

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos