title: StackOverflowError when matching SQL query
body: <p>My task is to shorten a large SQL query for logging purpose. As such, I need  to match a query like this: </p>
  
  <pre><code>INSERT INTO analytics_events (person_id,other_person_id,location_id,location_name,date,action,type,info,created_at,updated_at) VALUES
  (123, 456, 19, 'Sarasota', '2018-10-31 09:08:17.982', 'send', 'email', 'Subject: Check out this cat video', '2018-10-31 09:09:17.982', '2018-10-31 09:09:17.982'),
  (321, 654, 89, 'Indianapolis', '2018-10-31 09:08:18.982', 'read', 'page', 'Title: You\'ll Never Believe What they said', '2018-10-31 09:09:19.982', '2018-10-31 09:09:19.982'),
  ... '9998 more rows')
  (123, 456, 19, 'Sarasota', '2018-10-31 09:08:17.982', 'send', 'email', 'Subject: Check out this cat video', '2018-10-31 09:09:17.982', '2018-10-31 09:09:17.982'),
  (321, 654, 89, 'Indianapolis', '2018-10-31 09:08:18.982', 'read', 'page', 'Title: You\'ll Never Believe What they said', '2018-10-31 09:09:19.982', '2018-10-31 09:09:19.982'),
  ... '9998 more rows')
  (123, 456, 19, 'Sarasota', '2018-10-31 09:08:17.982', 'send', 'email', 'Subject: Check out this cat video', '2018-10-31 09:09:17.982', '2018-10-31 09:09:17.982'),
  (321, 654, 89, 'Indianapolis', '2018-10-31 09:08:18.982', 'read', 'page', 'Title: You\'ll Never Believe What they said', '2018-10-31 09:09:19.982', '2018-10-31 09:09:19.982'),
  ... '9998 more rows')
  (123, 456, 19, 'Sarasota', '2018-10-31 09:08:17.982', 'send', 'email', 'Subject: Check out this cat video', '2018-10-31 09:09:17.982', '2018-10-31 09:09:17.982'),
  (321, 654, 89, 'Indianapolis', '2018-10-31 09:08:18.982', 'read', 'page', 'Title: You\'ll Never Believe What they said', '2018-10-31 09:09:19.982', '2018-10-31 09:09:19.982'),
  ... '9998 more rows')
  (123, 456, 19, 'Sarasota', '2018-10-31 09:08:17.982', 'send', 'email', 'Subject: Check out this cat video', '2018-10-31 09:09:17.982', '2018-10-31 09:09:17.982'),
  (321, 654, 89, 'Indianapolis', '2018-10-31 09:08:18.982', 'read', 'page', 'Title: You\'ll Never Believe What they said', '2018-10-31 09:09:19.982', '2018-10-31 09:09:19.982'),
  ... '9998 more rows')
  (123, 456, 19, 'Sarasota', '2018-10-31 09:08:17.982', 'send', 'email', 'Subject: Check out this cat video', '2018-10-31 09:09:17.982', '2018-10-31 09:09:17.982'),
  (321, 654, 89, 'Indianapolis', '2018-10-31 09:08:18.982', 'read', 'page', 'Title: You\'ll Never Believe What they said', '2018-10-31 09:09:19.982', '2018-10-31 09:09:19.982'),
  ... '9998 more rows')
  (123, 456, 19, 'Sarasota', '2018-10-31 09:08:17.982', 'send', 'email', 'Subject: Check out this cat video', '2018-10-31 09:09:17.982', '2018-10-31 09:09:17.982'),
  (321, 654, 89, 'Indianapolis', '2018-10-31 09:08:18.982', 'read', 'page', 'Title: You\'ll Never Believe What they said', '2018-10-31 09:09:19.982', '2018-10-31 09:09:19.982'),
  ... '9998 more rows')
  (123, 456, 19, 'Sarasota', '2018-10-31 09:08:17.982', 'send', 'email', 'Subject: Check out this cat video', '2018-10-31 09:09:17.982', '2018-10-31 09:09:17.982'),
  (321, 654, 89, 'Indianapolis', '2018-10-31 09:08:18.982', 'read', 'page', 'Title: You\'ll Never Believe What they said', '2018-10-31 09:09:19.982', '2018-10-31 09:09:19.982'),
  ... '9998 more rows')
  (123, 456, 19, 'Sarasota', '2018-10-31 09:08:17.982', 'send', 'email', 'Subject: Check out this cat video', '2018-10-31 09:09:17.982', '2018-10-31 09:09:17.982'),
  (321, 654, 89, 'Indianapolis', '2018-10-31 09:08:18.982', 'read', 'page', 'Title: You\'ll Never Believe What they said', '2018-10-31 09:09:19.982', '2018-10-31 09:09:19.982'),
  ... '9998 more rows')
  (123, 456, 19, 'Sarasota', '2018-10-31 09:08:17.982', 'send', 'email', 'Subject: Check out this cat video', '2018-10-31 09:09:17.982', '2018-10-31 09:09:17.982'),
  (321, 654, 89, 'Indianapolis', '2018-10-31 09:08:18.982', 'read', 'page', 'Title: You\'ll Never Believe What they said', '2018-10-31 09:09:19.982', '2018-10-31 09:09:19.982'),
  ... '9998 more rows')
  </code></pre>
  
  <p>My Regex code is: </p>
  
  <pre><code>Pattern.compile("INSERT(.|\\n)*INTO(.|\\n)*VALUES(.|\\n)*", Pattern.CASE_INSENSITIVE);
  </code></pre>
  
  <p>Unfortunately, this is causing this exception: </p>
  
  <pre><code>java.lang.StackOverflowError
      at java.util.regex.Pattern$CharProperty.match(Pattern.java:3774)
      at java.util.regex.Pattern$Branch.match(Pattern.java:4604)
      at java.util.regex.Pattern$GroupHead.match(Pattern.java:4658)
      at java.util.regex.Pattern$Loop.match(Pattern.java:4785)
      at java.util.regex.Pattern$GroupTail.match(Pattern.java:4717)
  </code></pre>
  
  <p>My goal is to convert this SQL text to something that has no data component, such as: </p>
  
  <pre><code>INSERT INTO analytics_events (person_id,other_person_id,location_id,location_name,date,action,type,info,created_at,updated_at)
  </code></pre>
  
  <p>For the purpose of aggregating timing statistics for queries. </p>