My array contains strings with a specific format:
obj-meta_version-11_info
obj-meta_version-12_info
obj-meta_version-13_info
I need to loop through this array to identify objects that adhere to this naming convention. I think the regex pattern should be something like this:
obj-meta_version-([\d .]+)_info
Here's an example of what I'm trying to accomplish:
for(let i=0; i<body.length; i++){
if body[i].name = obj-meta_version-([\d .]+)_info {
// do stuff
}
}
How can I correctly rewrite this if statement in JavaScript to utilize the regex? I have a background in Python, so I'm not quite sure how to do this.