The regex is splitting string on word before colon, i am trying to bold the word before colon like aaaaa bb ccc need to be bold
str = "aaaaa: lorem ipsum bb: do lor sit amet ccc: no pro movet"
regex = / (?=\w+:)/g
splitString = str.split(regex)
console.log(splitString)
output of the above code is:
[
"aaaaa: lorem ipsum",
"bb: do lor sit amet",
"ccc: no pro movet"
]