title: Java regular expressions: ignore all characters until certain character. regex
body: <p>I am writing a java program to download PDFs automatically from a website. My program reads through an excel file, and downloads the PDF for every account number in the excel file. In the browser, the account is selected from a menu, however, the menu has the format of # storenumber - accountnumber (ex. # 1234 - 987654321). I do not have access to the store numbers. A simple solution would be just to ignore the first x characters, but some of the store numbers are different length so this does not work. </p>
  
  <p>Is it possible for java to disregard all the characters before the  -  , and if it is could you write out this expression.</p>
  
  <p>I am using it with selenium and firefox webdriver, making it harder to simply seperate and save the string. Meaning I do NOT have the string in memory, it is coming from the browser. </p>
  
  <p>This is what my code would look like IF i had the store numbers (but i dont).</p>
  
  <p><code>new Select(driver.findElement(By.id("ctl00_main_ddlAssocAccountNumbers"))).selectByVisibleText(storeNum + " - " + accountNum);</code></p>
  
  <p>Any other solutions or suggestions are appreciated.</p>
  
  <p>Thanks,
  Torbir</p>