~ubuntu-branches/ubuntu/utopic/zendframework/utopic

« back to all changes in this revision

Viewing changes to library/Zend/Filter/Word/CamelCaseToSeparator.php

  • Committer: Bazaar Package Importer
  • Author(s): Frank Habermann
  • Date: 2010-04-28 20:10:00 UTC
  • mfrom: (1.3.1 upstream) (9.1.4 sid)
  • Revision ID: james.westby@ubuntu.com-20100428201000-o347bj5qb5i3tpot
Tags: 1.10.4-1
new upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 * @package    Zend_Filter
17
17
 * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
18
18
 * @license    http://framework.zend.com/license/new-bsd     New BSD License
19
 
 * @version    $Id: CamelCaseToSeparator.php 20096 2010-01-06 02:05:09Z bkarwin $
 
19
 * @version    $Id: CamelCaseToSeparator.php 21089 2010-02-19 06:49:15Z thomas $
20
20
 */
21
21
 
22
22
/**
36
36
    public function filter($value)
37
37
    {
38
38
        if (self::isUnicodeSupportEnabled()) {
39
 
            parent::setMatchPattern(array('#(?<=(?:\p{Lu}))(\p{Lu}\p{Ll})#','#(?<=(?:\p{Ll}))(\p{Lu})#'));
 
39
            parent::setMatchPattern(array('#(?<=(?:\p{Lu}))(\p{Lu}\p{Ll})#','#(?<=(?:\p{Ll}|\p{Nd}))(\p{Lu})#'));
40
40
            parent::setReplacement(array($this->_separator . '\1', $this->_separator . '\1'));
41
41
        } else {
42
 
            parent::setMatchPattern(array('#(?<=(?:[A-Z]))([A-Z]+)([A-Z][A-z])#', '#(?<=(?:[a-z]))([A-Z])#'));
 
42
            parent::setMatchPattern(array('#(?<=(?:[A-Z]))([A-Z]+)([A-Z][A-z])#', '#(?<=(?:[a-z0-9]))([A-Z])#'));
43
43
            parent::setReplacement(array('\1' . $this->_separator . '\2', $this->_separator . '\1'));
44
44
        }
45
45