A
Andreas Grupp
Hello
I have the following code (reduced to reproduce the significant part of
the problem) which produces an error:
#!/usr/bin/perl -w
$horizcode = '<a href="test">*Start</a>';
$tiefsterMenuText = '*Start';
$horizcode s=~ !$tiefsterMenuText!<span>$tiefsterMenuText</span>!;
Error is ==> Quantifier follows nothing in regex
Perl sees the substition as:
$horizcode s=~ !*Start!<span>$tiefsterMenuText</span>!;
and interprets the "*" in the search-part of this substitute.
How can I solve this problem and search for a string with a leading "*"?
Andreas
I have the following code (reduced to reproduce the significant part of
the problem) which produces an error:
#!/usr/bin/perl -w
$horizcode = '<a href="test">*Start</a>';
$tiefsterMenuText = '*Start';
$horizcode s=~ !$tiefsterMenuText!<span>$tiefsterMenuText</span>!;
Error is ==> Quantifier follows nothing in regex
Perl sees the substition as:
$horizcode s=~ !*Start!<span>$tiefsterMenuText</span>!;
and interprets the "*" in the search-part of this substitute.
How can I solve this problem and search for a string with a leading "*"?
Andreas