Find a semicolon that matches the next colon

margin-top:20px;font-size:12px;color:-sharp000;
for example, how to match to font-size:12px;


does not understand your topic, what is the semicolon before the next colon;
the content between two semicolons can be: / [^;\:] +: [^;\:] +; / g


var str = string.split (";) [2]


I think it should be to convert the style string into an object so that it is easy to find a little

.
function getStyleObj(styles){
    let obj = {}
    styles.split(';')
    .filter(style => !!style)
    .forEach((style)=>{
        
       let styleArr = style.split(':')
       obj[styleArr[0]]=styleArr[1]
    
    })
    
    return obj
}
const styleObj = getStyleObj('margin-top:20px;font-size:12px;color:-sharp000;')
console.log(styleObj)

{
    'color':"-sharp000",
    'font-size':"12px",
    'margin-top':"20px"
}
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-1e47993-44c36.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-1e47993-44c36.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?