diff --git a/lib/rubocop/node_pattern.rb b/lib/rubocop/node_pattern.rb
index <HASH>..<HASH> 100644
--- a/lib/rubocop/node_pattern.rb
+++ b/lib/rubocop/node_pattern.rb
@@ -135,9 +135,11 @@ module RuboCop
       end
 
       def run(node_var)
-        tokens = @string.scan(TOKEN)
-        tokens.reject! { |token| token =~ /\A[\s,]+\Z/ } # drop whitespace
+        tokens =
+          @string.scan(TOKEN).reject { |token| token =~ /\A#{SEPARATORS}\Z/ }
+
         @match_code = compile_expr(tokens, node_var, false)
+
         fail_due_to('unbalanced pattern') unless tokens.empty?
       end
 
diff --git a/spec/rubocop/node_pattern_spec.rb b/spec/rubocop/node_pattern_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/rubocop/node_pattern_spec.rb
+++ b/spec/rubocop/node_pattern_spec.rb
@@ -912,11 +912,10 @@ describe RuboCop::NodePattern do
   end
 
   describe 'commas' do
-    # commas are just whitespace
     context 'with commas randomly strewn around' do
       let(:pattern) { ',,(,send,, ,int,:+, int ), ' }
       let(:ruby) { '1 + 2' }
-      it_behaves_like :matching
+      it_behaves_like :invalid
     end
   end
Drop support for extra commas in node patterns (part 2)

Work started in #<I>. However, node patterns would still allow commas,
due to another hard coded instance of the regexp that is now extracted
into `NodePattern::Compiler::SEPARATORS`.