note
danger
<blockquote>
Please help me understand the below reg expressions:
<code>
/^\s*$/
</code>
means check for all spaces in the entry. Check for beginning spaces and spaces in the middle and ending with a
space??
</blockquote>
<p>
It means: match the beginning of the string, followed by zero or more
whitespace characters, followed by the end of the string. Essentially,
it matches what we often think of as a "blank" line.
<blockquote>
<code>
/^\w{1,}@/
</code>
Check for beginning with one word only and a '@' ??
</blockquote>
<p>
Match beginning of string, followed by 1 or more word characters (those
being of the class: <code>[a-zA-Z0-9_]</code>) followed by the '@'
character.
<p>
To really understand regular expressions better, please see the following
documents: [perldoc://perlrequick], [perldoc://perlretut],
[perldoc://perlre]. Also, Jeffrey Friedl's "Mastering Regular Expressions"
is an excellent resource.
307166
307166