title: Regex for strings from a, b such that each a is immediately preceded and followed by b
body: <p>I'm trying to learn regular expressions through some practice problems I found online. The question apparently comes from Jurafsky's book on NLP and the solution cited everywhere is:
  (b+(ab+)+)?</p>
  
  <p>I don't think this is correct because it would leave out the possibility of strings consisting in a single b.</p>
  
  <p>My proposed solution is (b+(ab+)*)? or (b+(ab+)*)*</p>
  
  <p>Is my conclusion incorrect?</p>
  
  <p>Question original text: The set of all strings from the alphabet a, b such that each a is immediately preceded by and immediately followed by a b.</p>