Skip to content

Commit f0937d8

Browse files
committed
add negative lookahead to regex pattern matching, add whitespace matching to regex, fix docstring typo
1 parent d9b2e56 commit f0937d8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/vegaexpr.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export class VegaExprModel extends WidgetModel {
5050
const parsedMatch = match.match(/\[(.*?)\]/g)!;
5151
const column = parsedMatch[0];
5252

53-
// Column inxexing for regular element.
53+
// Column indexing for regular element.
5454
if (parsedMatch.length === 1) {
5555
return `(cell.row, ${column.match(/\[(.*?)\]/)![1]})`;
5656
}
@@ -69,7 +69,7 @@ export class VegaExprModel extends WidgetModel {
6969
private _augmentExpression(parsedValue: ParsedVegaExpr): ParsedVegaExpr {
7070
let codeToProcess = parsedValue.code;
7171
codeToProcess = codeToProcess.replace(
72-
/(?<=cell.metadata.data)(\[(.*?)\])+(?=[==,>=,<=,!=,<,>])/g,
72+
/(?<=cell.metadata.data)(\[(.*?)\])+(?!=[==,>=,<=,!=,<,>,\s])/g,
7373
this._processRegex,
7474
);
7575
parsedValue.code = codeToProcess;

0 commit comments

Comments
 (0)