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()
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1bf2b65-31e10.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1bf2b65-31e10.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?