Well, I’m stuck here and I don’t understand what the problem could be.
Problem:
In your highPrecedence function, declare a regex variable.
Assign it a regular expression that matches a number
(including decimal numbers) followed by a * or / operator
followed by another number.
Each number, and the operator, should be in
separate capture groups.
Solution:
const highPrecedence = str => {
const regex = /(\d*\.?\d+)\s*([\*\/])\s*(\d*\.?\d+)/;
}
Response:
Your first capture group should use a character class.
But in my solution there are A LOT of character class! Maybe the problem is the optional spaces…
const highPrecedence = str => {
const regex = /(\d*\.?\d+)([\*\/])(\d*\.?\d+)/;
}
Response:
Your first capture group should use a character class.
Ok, maybe the problem is the “type” of character class:
const highPrecedence = str => {
const regex = /([0-9]*\.?[0-9]+)([\*\/])([0-9]*\.?[0-9]+)/;
}
No. The response is:
Your first capture group should match any digit or a period.
Use the special \d character class.
Ok. I would just know what exactly the problem is asking to me.