title: Parsing text with Javascript
body: <p>I'm trying to use Javascript to parse text that has been entered in a text box - which would combine a variety of user-generated variables to create random activities.  This might make more sense looking at the example.  Some example input might be:</p>
  
  <pre>Activity
  @Home
  @Out
  
  @Home
  Read @book for @time
  Clean up @room for @time
  
  @Out
  Eat at at @restaurant
  
  @book
  Enders Game
  Lord of the Rings
  
  @room
  bedroom
  garage
  basement
  
  @restaurant
  Red Robin
  McDonalds
  Starbucks
  
  @time
  15 minutes
  30 minutes
  45 minutes
  60 minutes
  </pre>
  
  <p>Pound/and signs would be used to separate different categories.</p>
  
  <p>The output would then be determined randomly from the given input, for example:</p>
  
  <p>"Eat at Starbucks."
  or
  "Read Lord of the Rings for 60 minutes."
  or
  "Clean garage for 30 minutes."</p>
  
  <p>Is this doable?  It seems like it should be fairly straightforward, but I do not know where to start.  Any suggestions?</p>
  
  <p>Thanks,</p>
  
  <p>Albert</p>