JSFiddle - React, Tailwind, and code Playground

by cm0s

JavaScript

var str =  "<relativePath></relativePath><version>1.0.0</version>";
var regex = new RegExp('/<version>(.*)<\\/version>/i');
console.log('test1:');
str.replace(regex, function(match, version) {
    
    console.log('test:'+match);
    return version;
  });