tried everything still confuse
const highPrecedence = str => {
const regex = /([\d+|(\d+)?.\d+])(\d+)?([*|\/])(\s+)?(\d+|(\d+)?.\d+)$/ig
}
Your first capture group should match any digit or a period. Use the special \d
character class.
tried everything still confuse
const highPrecedence = str => {
const regex = /([\d+|(\d+)?.\d+])(\d+)?([*|\/])(\s+)?(\d+|(\d+)?.\d+)$/ig
}
Your first capture group should match any digit or a period. Use the special \d
character class.
go simpler, the regex you need is much shorter than that
Hello, I’m stuck with this as well. I tried to take it step by step and can’t seem to figure this out. I currently have /([\d.]+)([*/])([\d.]+)/. I tried modifying the second capture case to -([*/]) as well but still can’t get it.
please disregard, I figured it out.
This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.