JSFiddle - React, Tailwind, and code Playground

JavaScript

$(function() {
    var context = '<html><head><title>Hello</title></head><body><a href="#">Click Here</a><p>This is my sentence.</p>< /body></html > ';

      var matches = context.match(/<title>(.*?)<\/title>/);
      var spUrlTitle = matches[1];
});