title: Regular expression to match an arbitrary length of characters in a string using javascript?
body: <p>I m just learning regular expression matching using javascript, and have a doubt regarding the scenario described below. </p>
  
  <p>I'm trying to validate email, with condition below:</p>
  
  <blockquote>
    <p>Format should be <code>xxx@yyy.zzz</code> where<br />
    A) "xxx", "yyy" and "zzz" parts
    can take values only between lowercase a and z<br />
    B) The length of zzz,
    yyy and xxx parts are arbitrary (should be minimum one though)</p>
  </blockquote>
  
  <p>Now I understand I can build the regex like this:
  <strong>EDIT:
  CORRECTED REG EXP
      <code>/[a-z]+@[a-z]+\.[a-z]+/</code></strong></p>
  
  <p>and the above would evaluate a string like "aaa@aaa.aaa" as true.</p>
  
  <p>But my concern is, in the above expression if i provide <code>"a999@aaa.aaa"</code>, again it would evaluate as true. Now, if i modify the reg ex as <code>**/[a-z]{1,}@[a-z]+\.[a-z]+/**</code> even then it would evaluate <code>"a999@aaa.aaa"</code> as true because of the presence of "a" as the first character. </p>
  
  <p>So, I would like to know how to match the first part "xxx" in the email <code>"xxx@yyy.zzz"</code> in a way that it checks the entire string from first char till it reaches the @ symbol with the condition that it should take only a to z as valid value.</p>
  
  <p>In other words, the regex should not mind the length of the username part of email, and irrespective of the number of chars entered, it should test it based on the specified regex condition, and it should test it for the set of chars from index 1 to index of @.</p>