title: Regex: test if character 1 appears before character 2 anywhere in string
body: <p>I'm having trouble making sense of a regex. I need a regex to test a url. I would like the regex to match if <code>?</code> comes before <code>#</code> anywhere in the string.</p>
  
  <p>Want to pass:
  - <code>test.com/?test=thisshouldmatch#/asjldfj/lskjdf</code></p>
  
  <p>Want to fail
  - <code>test.com/#/thisshouldfail?test=laskjdflkajsd</code></p>
  
  <p>I thought a lookahead would be good for this, but I need it to not be restricted to matching only if the characters are immediately after each other.</p>
  
  <p>Thanks in advance for any help.</p>