[pmwiki-users] PTV Confusion.

sti at pooq.com sti at pooq.com
Thu Sep 20 15:28:29 CDT 2007


Guillermo Calderon - INCO wrote:
> 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 '-'?

> 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',
>                                             ^^^^
>                                        (only word characters)
> 

Thanks! I naively assumed that the same regex was (somehow) used in both
places. I'll fix my copy.



More information about the pmwiki-users mailing list