JSFiddle - React, Tailwind, and code Playground
JavaScript
var input = "MIN20, MAX40";
var matches = input.match(/MIN(\d+), MAX(\d+)/);
var min = matches[1];
var max = matches[2];
document.write(min + ' ');
document.write(max);
var input = "MIN20, MAX40";
var matches = input.match(/MIN(\d+), MAX(\d+)/);
var min = matches[1];
var max = matches[2];
document.write(min + ' ');
document.write(max);