From 323e815d5fcd1b44b5fd51130f32ad61163c509c Mon Sep 17 00:00:00 2001 From: Bilal Catic Date: Thu, 23 Jan 2020 18:14:53 +0100 Subject: [PATCH] remove pipe character from allowed set for unqoted term --- spec/query_lexer_spec.rb | 9 --------- specification.rex | 2 +- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/spec/query_lexer_spec.rb b/spec/query_lexer_spec.rb index 0da9c3b..9fd4e77 100644 --- a/spec/query_lexer_spec.rb +++ b/spec/query_lexer_spec.rb @@ -129,15 +129,6 @@ class QueryLexerTester expect(@result[2][1]).to eq '"name with space"' end - it 'tests search term without quotes containing pipe characters' do - @result = @evaluator.tokenize('||') - - expect(@result.length).to eq 1 - - expect(@result[0][0]).to eq :TERM_WITHOUT_QUOTES - expect(@result[0][1]).to eq '||' - end - it 'tests search term with quotes containing non alphanumerical characters' do @result = @evaluator.tokenize('"|*|/\()#-!=<>&$"') diff --git a/specification.rex b/specification.rex index f0b3375..4ac4649 100644 --- a/specification.rex +++ b/specification.rex @@ -7,7 +7,7 @@ macro OPERATOR_AND (?i)and OPERATOR_NOT (?i)not TERM_WITH_QUOTES "([^"]*)" - TERM_WITHOUT_QUOTES [a-zA-Z0-9-_|]+ + TERM_WITHOUT_QUOTES [a-zA-Z0-9-_]+ COLON \: