- or download this
(??{ code })
...
...
subexpression may match. The result of evaluation is
considered as a regular expression and matched as if
it were inserted instead of this construct.
- or download this
1 while s!([BUI])(<+)\s*(.*?)\s*(??{'>' x length $2})!<$1>$3</$1>!;
- or download this
"B<<< I<< U<bold underlined text> >> >>>"
- or download this
<B><I><U>bold underlined text</U></I></B>
- or download this
my $pod2html = qr/
([BUI]) # start of formatting pattern
...
\s*(.*?)\s* # collect text, without border space
(??{'>' x length($2)}) # match same number of closing braces
/x;