mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-07 18:32:40 +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
|
// Split the string into separate expressions
|
||||||
|
|
||||||
//const variableRegex = /[a-zA-Z_][a-zA-Z0-9_]*(?=\s*(?:[+\-*\/)]|$))/g;
|
//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 matches = label.split(mathRegex)
|
||||||
let mathVars = matches.filter(match => isNaN(match))?.map((s)=>s.trim()); // Capture any variable names
|
let mathVars = matches.filter(match => isNaN(match))?.map((s)=>s.trim()); // Capture any variable names
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user