Skip to content
This repository was archived by the owner on Aug 29, 2025. It is now read-only.

Commit 6140a88

Browse files
author
Shammamah Hossain
committed
Ensure that trailing space does not get captured.
1 parent aae4907 commit 6140a88

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/dash-table/syntax-tree/lexeme/relational.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ export const contains: IUnboundedLexeme = R.merge({
5757
op.toString().indexOf(exp.toString()) !== -1
5858
),
5959
subType: RelationalOperator.Contains,
60-
regexp: /^(contains(\s|$))/i
60+
regexp: /^((contains)(?:\s|$))/i
6161
}, LEXEME_BASE);
6262

6363
export const equal: IUnboundedLexeme = R.merge({
@@ -67,19 +67,19 @@ export const equal: IUnboundedLexeme = R.merge({
6767
op === exp
6868
),
6969
subType: RelationalOperator.Equal,
70-
regexp: /^(=|eq(\s|$))/i
70+
regexp: /^(=|(eq)(?:\s|$))/i
7171
}, LEXEME_BASE);
7272

7373
export const greaterOrEqual: IUnboundedLexeme = R.merge({
7474
evaluate: relationalEvaluator(([op, exp]) => op >= exp),
7575
subType: RelationalOperator.GreaterOrEqual,
76-
regexp: /^(>=|ge(\s|$))/i
76+
regexp: /^(>=|(ge)(?:\s|$))/i
7777
}, LEXEME_BASE);
7878

7979
export const greaterThan: IUnboundedLexeme = R.merge({
8080
evaluate: relationalEvaluator(([op, exp]) => op > exp),
8181
subType: RelationalOperator.GreaterThan,
82-
regexp: /^(>|gt(\s|$))/i
82+
regexp: /^(>|(gt)(?:\s|$))/i
8383
}, LEXEME_BASE);
8484

8585
const DATE_OPTIONS: IDateValidation = {
@@ -100,23 +100,23 @@ export const dateStartsWith: IUnboundedLexeme = R.merge({
100100
normalizedOp.indexOf(normalizedExp) === 0;
101101
}),
102102
subType: RelationalOperator.DateStartsWith,
103-
regexp: /^(datestartswith(\s|$))/i
103+
regexp: /^((datestartswith)(?:\s|$))/i
104104
}, LEXEME_BASE);
105105

106106
export const lessOrEqual: IUnboundedLexeme = R.merge({
107107
evaluate: relationalEvaluator(([op, exp]) => op <= exp),
108108
subType: RelationalOperator.LessOrEqual,
109-
regexp: /^(<=|le(\s|$))/i
109+
regexp: /^(<=|(le)(?:\s|$))/i
110110
}, LEXEME_BASE);
111111

112112
export const lessThan: IUnboundedLexeme = R.merge({
113113
evaluate: relationalEvaluator(([op, exp]) => op < exp),
114114
subType: RelationalOperator.LessThan,
115-
regexp: /^(<|lt(\s|$))/i
115+
regexp: /^(<|(lt)(?:\s|$))/i
116116
}, LEXEME_BASE);
117117

118118
export const notEqual: IUnboundedLexeme = R.merge({
119119
evaluate: relationalEvaluator(([op, exp]) => op !== exp),
120120
subType: RelationalOperator.NotEqual,
121-
regexp: /^(!=|ne(\s|$))/i
121+
regexp: /^(!=|(ne)(?:\s|$))/i
122122
}, LEXEME_BASE);

0 commit comments

Comments
 (0)