Java regex to get part number
        Posted  
        
            by Blankman
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by Blankman
        
        
        
        Published on 2010-04-17T23:11:03Z
        Indexed on 
            2010/04/17
            23:13 UTC
        
        
        Read the original article
        Hit count: 252
        
I have HTML that I need to extract a part number from, the HTML looks like:
javascript:selectItem('ABC123          1', '.....
I need to get the ABC123 from the above.
My code snippet:
Patterp p = Pattern.Compile("?????");
Matcher m = p.matcher(html);
if(m.find())
  partNumber = m.group(1).trim();
BTW, in the pattern, how do I escape for the character (
I now for quotes I do \"
thanks allot!
© Stack Overflow or respective owner