[pmwiki-users] PTV Confusion.
Guillermo Calderon - INCO
calderon at fing.edu.uy
Thu Sep 20 14:12:59 CDT 2007
Stirling Westrup wrote:
> What are the legal characters in the name of a PTV? Looking at the regexes
> inside pmwiki.php (latest version), I see:
>
> $PageTextVarPatterns = array(
> 'var:' => '/^(:*\\s*(\\w[-\\w]*)\\s*:[ \\t]?)(.*)($)/m',
> '(:var:...:)' => '/(\\(: *(\\w[-\\w]*) *:(?!\\))\\s?)(.*?)(:\\))/s'
> );
>
> Am I reading that wrong, or doesn't [-\\w] match any word character plus '-'?
> The reason I ask is that I can get simple PTV's to work, but not those that
> contain '-' in the names. I wish to have a bunch of entries like:
>
> Cat-A:one
> Cat-B:two
>
I think the problem is in the regexp for the markup {$:variable}:
in scripts/stdmarkup.php:
# {$var} substitutions
Markup('{$var}', '>$[phrase]',
'/\\{(\\*|!?[-\\w.\\/\\x80-\\xff]*)(\\$:?\\w+)\\}/e',
^^^^
here
(only word characters)
More information about the pmwiki-users
mailing list