title: regex for getting word right before brackets
body: <p>I have various strings with different information but they all share one common characteristic: they contain the username of the requester with brackets right after it.  Something like: <code>"... paul [55] ..."</code> I am trying to write a regex that is able to extract the word right before the <code>[dd]</code>
  <br />
  <br />
  This is what I have so far: <code>"/(?P&lt;user&gt;\w+)\s\[\d\d\]/"</code> but this only works if the string starts with the user, such as <code>"paul [55] has logged in"</code> but it wouldn't work in the case, <code>"user paul [55] has logged off"</code>
  <br />
  <br />
  What am I missing?</p>