Thanks Jim. that explains clearly.
On 2018/7/12 星期四 PM 10:00, Jim Gibson wrote:
On Jul 12, 2018, at 5:50 AM, Lauren C. <lau...@miscnote.net> wrote:
thanks for the kind helps.
do you know what the expression in { } stands for?
^(\S+) - - \[(\S+).*\] \"GET (.*?/)\s+
Here is a breakdown:
^ Start looking for matches at beginning of string
(\S+) Match a consecutive sequence of non-whitespace characters and save in
the $1 variable
— Match the literal string ‘ — ‘
\[ Match the character ‘[‘
(\S+) Match a consecutive sequence of non-whitespace characters and save in
the $2 variable
.* Match any consecutive zero or more characters
\] Match the character ‘]’
(space) Match a space character
\” Match the character ‘“‘
GET Match the literal string ‘GET ‘ (with a space at the end)
(.*?/) Match the shortest string of any consecutive characters up to but not
including a following whitespace and save in $3
\s+ Match any consecutive sequence of whitespace characters
If all of the above entities are matched, then the regular expression
evaluation returns true and the 41, $2, and $3 variables are assigned to their
captured matches.
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/