Owen <mailto:[EMAIL PROTECTED]> wrote:
: I found a message from Randal Schwartz, Message-ID:
: <[EMAIL PROTECTED]>#1/1
: which gave a regular expression for a valid Unix name,
:
: /^(?=.*?\D)[a-z\d]+$/
:
: That works but why does it work?
:
: /
: ^ # Start of a string
: (?= # 0 or 1 instance of
(?= # Zero-width positive look ahead assertion.
: .*? # anything but a newline
: ) #
:
: [a-z\d]+ # All match a-z and any digit at
[a-z\d]+ # Match a-z (lowercase only) and any digit
: $ # End of a string
: /
:
: I tried breaking it down like above but it still doesn't say
: "Must not be all numbers and letters must be all lowercase"
:
: Any help in turning that re into plain words would be
: appreciated
AFAIK, a (?= ... ) construct affects the contents of $&, $`,
and $'. Can you show any code immediately following this regular
expression and the whole line with it?
HTH,
Charles K. Clarkson
--
Mobile Homes Specialist
254 968-8328
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>