title: Java/Hive regex interpretation
body: <p>Straightforward question, it's just difficult to google regex syntax...</p>
  
  <p>I'm going through the <a href="http://hortonworks.com/hadoop-tutorial/how-to-process-data-with-apache-hive/" rel="nofollow">HortonWorks Hive tutorials</a> (Hive uses same regex as Java), and the following SELECT statement uses regex to pull from what's probably JSON data...</p>
  
  <pre><code>        INSERT OVERWRITE TABLE batting
          SELECT
          regexp_extract(col_value,'^(?:([^,]*)\.?){1}',1) player_id,
          regexp_extract(col_value,'^(?:([^,]*)\.?){2}',1) year,
          regexp_extract(col_value,'^(?:([^,]*)\.?){9}',1) run
          FROM temp_batting;
  </code></pre>
  
  <p>The data looks like this:</p>
  
  <p>PlayerID,yearID,stint,teamID,lgID,G,G_batting,AB,R,H,2B,3B,HR,RBI,SB,CS,BB,SO,IBB,HBP,SH,SF,GIDP,G_old
  aardsda01,2004,1,SFN,NL,11,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11
  aardsda01,2006,1,CHN,NL,45,43,2,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,45
  aardsda01,2007,1,CHA,AL,25,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2</p>
  
  <p>And so PlayerID is in column1, year is column2, R (runs) is column 9.  How is regexp_extract successfully pulling this data?</p>
  
  <p>I'm new to non-capturing groups, but it looks to me like the entire thing is a non-capturing group.  Also, I'm used to seeing {1}, {2}, or {9} in the form [0-9]{9} meaning it matches a 9-digit number.  In this case it looks like it's pointing to the 9th match of something, what is this syntax called? </p>