L
laredotornado
Hi,
I'm using Perl 5.8.9 for Mac 10.6.3. I'm found an expression to match
URLs in text (http://www.truerwords.net/articles/ut/
urlactivation.html), but I'm getting a syntax error for my line ...
if ($error_text =~ m/(^|[ \t\r\n])
((ftp|http|https|gopher|mailto|news|nntp|telnet|wais|file|prospero|aim|
webcal)([A-Za-z0-9$_.+!*(),;/?&~=-])|%[A-Fa-f0-9]{2}){2,}(#([a-zA-
Z0-9][a-zA-Z0-9$_.+!*(),;/?&~=%-]*))?([A-Za-z0-9$_+!*();/?:~-]))/) {
Specifically, the errors are
Bareword found where operator expected at log_analyzer.pl line 92,
near "%[A"
(Missing operator before A?)
syntax error at log_analyzer.pl line 92, near "?:"
syntax error at log_analyzer.pl line 93, near ""found url: $error_text
\n";"
Unmatched right curly bracket at log_analyzer.pl line 108, at end of
line
syntax error at log_analyzer.pl line 108, near "}"
Can anyone provide guidance as to how I can cure these syntax errors?
Thanks, - Dave
I'm using Perl 5.8.9 for Mac 10.6.3. I'm found an expression to match
URLs in text (http://www.truerwords.net/articles/ut/
urlactivation.html), but I'm getting a syntax error for my line ...
if ($error_text =~ m/(^|[ \t\r\n])
((ftp|http|https|gopher|mailto|news|nntp|telnet|wais|file|prospero|aim|
webcal)([A-Za-z0-9$_.+!*(),;/?&~=-])|%[A-Fa-f0-9]{2}){2,}(#([a-zA-
Z0-9][a-zA-Z0-9$_.+!*(),;/?&~=%-]*))?([A-Za-z0-9$_+!*();/?:~-]))/) {
Specifically, the errors are
Bareword found where operator expected at log_analyzer.pl line 92,
near "%[A"
(Missing operator before A?)
syntax error at log_analyzer.pl line 92, near "?:"
syntax error at log_analyzer.pl line 93, near ""found url: $error_text
\n";"
Unmatched right curly bracket at log_analyzer.pl line 108, at end of
line
syntax error at log_analyzer.pl line 108, near "}"
Can anyone provide guidance as to how I can cure these syntax errors?
Thanks, - Dave