in reply to HELP! I am in regex-hell
But your regex seems wrong anyway, since there is a space in between
DB<1> $line = 'Cache::Cache(3)' DB<2> x ($page , $section) = ( $line =~ /^((?:\w|:|-)+)(\(.*?\))?/) 0 'Cache::Cache' 1 '(3)' DB<3> $line = 'dhcp-config(5)' DB<4> x ($page , $section) = ( $line =~ /^([\w:-]+)(\(.*?\))?/) 0 'dhcp-config' 1 '(5)' DB<5>
Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: HELP! I am in regex-hell
by Anonymous Monk on Jul 15, 2020 at 20:35 UTC | |
|
Re^2: HELP! I am in regex-hell
by Anonymous Monk on Jul 15, 2020 at 12:50 UTC | |
by LanX (Saint) on Jul 15, 2020 at 13:15 UTC |