title: REGEXP_EXTRACT in Impala
body: <p>I am trying to figure out how to extract customer ID from string that looks loke this:</p>
  
  <pre><code>{"param":"success","value":"10","level":"0","error_code":"101","customer_id":"5b0e9b23e423b0d33c9f7ddfd", "purchases": "13", "last_activity_ts": "123523465"}
  </code></pre>
  
  <p>I am trying to extract customer ID from strings that contain error code 101 with following code:</p>
  
  <pre><code>select regexp_extract(field, '\"customer_id":"(.*)', 0) from table_name
  where field rlike '"error_code":"101"'
  </code></pre>
  
  <p>But this gives me a following result:</p>
  
  <pre><code>"customer_id":"5b0e9b23e423b0d33c9f7ddfd", "purchases": "13", "last_activity_ts": "123523465"}
  </code></pre>
  
  <p>Expected result:</p>
  
  <pre><code>5b0e9b23e423b0d33c9f7ddfd
  </code></pre>
  
  <p>Could you please help me with this?</p>