[pmwiki-users] serial number out of a pagename

Peter Bowers pbowers at pobox.com
Tue Aug 12 10:49:13 CDT 2008


if (preg_replace('/-([^\d]+)$/',"",$name, $m)
  $number = $m[1];

-Peter

On Tue, Aug 12, 2008 at 5:32 PM, noskule <noskule at gmx.net> wrote:
> hi list
> I build serialized pages with powertools / serialname. What the best way
> to get the number out of the pagename? I want to do a pagevar $SerialNumber.
>
> I tried with a regexpr:
> Group.Name-0001
>  $number = preg_replace('/-[^\d]+$/',"",$name);
>
> I get -1 as result.
> Any suggestions?
> thanks nos
>
> _______________________________________________
> pmwiki-users mailing list
> pmwiki-users at pmichaud.com
> http://www.pmichaud.com/mailman/listinfo/pmwiki-users
>



More information about the pmwiki-users mailing list