what does /^[^ ]/ mean in perl?
what does /^[^ ]/ mean in perl?
Collapse
X
-
Monica PnadeTags: None -
It is a regular expression which matches any non-space character at the beginning of a string.
perlre
YAPE::Regex::Ex plain
Code:use strict; use warnings; use YAPE::Regex::Explain; print YAPE::Regex::Explain->new(qr/^[^ ]/)->explain(); __END__ The regular expression: (?-imsx:^[^ ]) matches as follows: NODE EXPLANATION ---------------------------------------------------------------------- (?-imsx: group, but do not capture (case-sensitive) (with ^ and $ matching normally) (with . not matching \n) (matching whitespace and # normally): ---------------------------------------------------------------------- ^ the beginning of the string ---------------------------------------------------------------------- [^ ] any character except: ' ' ---------------------------------------------------------------------- ) end of grouping ----------------------------------------------------------------------
Comment