mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2025-12-26 13:52:38 +00:00
Add exponents via '^'
This commit is contained in:
@@ -336,7 +336,7 @@ const replaceVar = function(input, hoist=false) {
|
||||
// Split the string into separate expressions
|
||||
|
||||
//const variableRegex = /[a-zA-Z_][a-zA-Z0-9_]*(?=\s*(?:[+\-*\/)]|$))/g;
|
||||
let mathRegex = /[a-z]+\(|[+\-*/()]/g;
|
||||
let mathRegex = /[a-z]+\(|[+\-*/^()]/g;
|
||||
let matches = label.split(mathRegex)
|
||||
let mathVars = matches.filter(match => isNaN(match))?.map((s)=>s.trim()); // Capture any variable names
|
||||
|
||||
|
||||
Reference in New Issue
Block a user