How to use regular to intercept the string you want?

.
E2AB7DAF-D668-44F8-B38D-252FE2D025E9.5304
E2AB7DAF-D668-44F8-B38D-252FE2D025E9.1000
E2AB7DAF-D668-44F8-B38D-252FE2D025E9.66666
Mar.14,2021

use regular packet matching:

var str='E2AB7DAF-D668-44F8-B38D-252FE2D025E9.5304'
console.log(str.match(/(\w+)\.(\d+)/)[2])

so you can get the number you want.


using regular reverse positive pre-check, matching "before is." And ends with an indefinite number "

"
var str='E2AB7DAF-D668-44F8-B38D-252FE2D025E9.5304'
str.match(/(?<=\.)\d+$/)[0] // "5304"

Please see the code and code comments

can be copied to the browser Console and run directly

function getNum() {
    var str =
        "E2AB7DAF-D668-44F8-B38D-252FE2D025E9.5304 E2AB7DAF-D668-44F8-B38D-252FE2D025E9.1000 E2AB7DAF-D668-44F8-B38D-252FE2D025E9.66666"
    var reg = /\.\d+/g //"\.""." "d+"g
    var result = str.match(reg)  //
    console.log(result) //[".5304", ".1000", ".66666"]
    for (var i = 0; i < result.length; iPP) { //
        var s = result[i].substring(1)  //
        console.log(s)  //5304 1000 66666
    }
}
getNum()
Menu