JSFiddle - React, Tailwind, and code Playground

by Zaheer Ahmed

JavaScript

var yourString="hello word:2asd tsfa";
var yourString1="hello word:this tsfa";
var yourString2="hello word:1235 tsfa";
var patt1=/:(\w*)/;
alert(yourString.match(patt1)[1]);
alert(yourString1.match(patt1)[1]);
alert(yourString2.match(patt1)[1]);