function matchesPattern(str) {
let arr = str.split('-')
let result = true
arr.forEach((item, index) => {
if (index === 0 || index === 1) {
if (item.length !== 3) {
result = false
return
}
}
if (index === 2) {
if (item.length !== 4) {
result = false
return
}
}
if (isNaN(Number(item))) {
result = false
}
})
return result
}