title: Extract text from pdf file based on regular expression?
body: <p>i have a pdf file which have number of 300 pages, and each set of pages contains identifying information for a person such as the social security number.</p>
  
  <p>let's say that pages from 1-4 are for the social number 987-65-4320 and pages from 5-6 are for 987-65-4321</p>
  
  <p>i want to extract all the information for the first employee <strong>starting from</strong> the <strong>first social number position</strong>  to the <strong>second social number position</strong> then save them in a new pdf file.</p>
  
  <p>all the examples i saw was about extracting all the text from pdf file, not based on specific criteria like this one:</p>
  
  <p><a href="https://stackoverflow.com/questions/4026614/extract-text-from-pdf-files">extract text from pdf files</a></p>
  
  <p>please advise how to accomplish that.</p>