You can omit {1} from your regex and if you don't use the capturing group (x|X) you could write that as [xX] or just x with the case insensitive flag /i.
Your regex could look like \d+x\d+$ using the and if your want to return a boolean you can use test.
Note that you don't use the single quotes for let pattern and if you use \d* that would match zero or more digits and would also match a single x.
let str = "35x35";
let pattern = /^\d+x\d+$/i;
console.log(pattern.test(str));
Or use match to retrieve the matches.
let str = "35x35";
let pattern = /^\d+x\d+$/i;
console.log(str.match(pattern)[0]);
/^\d+x\d+$/i.test(string).