title: Kleene's Star: why does $_ = "a"; s/a*/e/g produce: ee
body: <p><code>a*</code> means zero or more instances of: a right?</p>
  
  <p>so why does <code>$_ = "a"; s/a*/e/g</code> produce: <code>ee</code></p>
  
  <p>Possible answer: it's replacing the string: "a" with: "e" and it's replacing the empty string: "" with: "e" as well. Or it's replacing the mere absence of a letter: a with a letter: e or it's replacing "zero occurrences" of: a with an: e</p>
  
  <p>Ok then, but:</p>
  
  <p><code>$_ = "b"; s/a*/e/g</code> produces: <code>ebe</code></p>
  
  <p>It seems to be replacing the empty string to the left of: <code>b</code> and <em>also</em> the empty string to the right of: <code>b</code></p>
  
  <p>OK. But then why doesn't it do that for: "<code>a</code>" ? Why doesn't it replace the empty string to the left of: <code>a</code> and <em>also</em> the empty string to the right of: a and <em>also</em> the letter: a itself to get: <code>eee</code> ?</p>
  
  <p>There are just as many zero occurrences of: a on the left side as the right side!</p>