JSFiddle - React, Tailwind, and code Playground

Regular expression pattern match to obtain last whole number in a string of text

by Terry King

HTML

<div id="results"></div>

JavaScript

//Last number in a string
l="http://port.fora/2profile/Claude/phototest/photographer/110/";
var patt=l.match('.*/([0-9]+)')[1];
$("#results").html(patt);

patt=l.match('.*/([0-9]+)')[1];
$("#results").append("<br>"+patt);