JSFiddle - React, Tailwind, and code Playground

JavaScript

const phoneReg = /^\s*(\+7|8)[ (-]*([0-9]{3})[ )-]*([0-9]{3})[ -]*([0-9]{2})[ -]*([0-9]{2})\s*$/;
let matches = phoneReg.exec('+7(900)123-45-67');
console.log(matches);