100+ results for 'php preg_match_all'

Not the results you expected?

Batch.php (https://bitbucket.org/khuongduybui/openfisma.git) PHP · 248 lines

1 <?php

2 /**

3 * Zend Framework

24 * @see Zend_Service_WindowsAzure_Exception

25 */

26 // require_once 'Zend/Service/WindowsAzure/Exception.php';

27

28 /**

29 * @see Zend_Service_WindowsAzure_Storage_BatchStorageAbstract

30 */

31 // require_once 'Zend/Service/WindowsAzure/Storage/BatchStorageAbstract.php';

32

33 /**

207 // Parse response

208 $errors = null;

209 preg_match_all('/<message (.*)>(.*)<\/message>/', $response->getBody(), $errors);

210

211 // Error?

Batch.php (https://github.com/kiranatama/sagalaya.git) PHP · 245 lines

1 <?php

2 /**

3 * Zend Framework

204 // Parse response

205 $errors = null;

206 preg_match_all('/<message (.*)>(.*)<\/message>/', $response->getBody(), $errors);

207

208 // Error?

Batch.php (https://bitbucket.org/DragonBe/zfform.git) PHP · 241 lines

1 <?php

2 /**

3 * Zend Framework

130 if ($httpVerb == Zend_Http_Client::GET) {

131 if (count($this->_operations) > 0) {

132 require_once 'Zend/Service/WindowsAzure/Exception.php';

133 throw new Zend_Service_WindowsAzure_Exception("Select operations can only be performed in an empty batch transaction.");

134 }

199 // Parse response

200 $errors = null;

201 preg_match_all('/<message (.*)>(.*)<\/message>/', $response->getBody(), $errors);

202

203 // Error?

204 if (count($errors[2]) > 0) {

205 require_once 'Zend/Service/WindowsAzure/Exception.php';

206 throw new Zend_Service_WindowsAzure_Exception('An error has occured while committing a batch: ' . $errors[2][0]);

207 }

qubaid_condition_test.php (https://github.com/jfilip/moodle.git) PHP · 161 lines

1 <?php

2 // This file is part of Moodle - http://moodle.org/

3 //

16

17 /**

18 * This file contains tests for some of the code in ../datalib.php.

19 *

20 * @package moodlecore

28

29 global $CFG;

30 require_once(dirname(__FILE__) . '/../lib.php');

31

32

41 protected function normalize_sql($sql, $params) {

42 $newparams = array();

43 preg_match_all('/(?<!:):([a-z][a-z0-9_]*)/', $sql, $named_matches);

44 foreach($named_matches[1] as $param) {

45 if (array_key_exists($param, $params)) {

datalib_test.php (https://github.com/telematika/moodle.git) PHP · 161 lines

1 <?php

2 // This file is part of Moodle - http://moodle.org/

3 //

16

17 /**

18 * This file contains tests for some of the code in ../datalib.php.

19 *

20 * @package moodlecore

28

29 global $CFG;

30 require_once(dirname(__FILE__) . '/../lib.php');

31

32

33 /**

34 * Unit tests for some of the code in ../datalib.php.

35 *

36 * @copyright 2009 The Open University

StringParser.php (git://github.com/egeniq/adapto.git) PHP · 213 lines

1 <?php

2 /**

3 * This file is part of the Adapto Toolkit.

153 {

154 $matches = array();

155 preg_match_all("/\[[^\]]*\]|[^[]+/", $this->m_string, $matches);

156 return $matches;

157 }

ElementLiteral.php (https://gitlab.com/src-run/jabiru) PHP · 310 lines

1 <?php

2

3 namespace Scribe\Jabiru\Component\Element;

257

258 // @codeCoverageIgnoreStart

259 return preg_match_all("/[\\\\x00-\\\\xBF]|[\\\\xC0-\\\\xFF][\\\\x80-\\\\xBF]*/", $this->text);

260 // @codeCoverageIgnoreEnd

261 }

WCDate.php (https://github.com/ChuguluGames/mediawiki-svn.git) PHP · 1119 lines

1 <?php

2 /**

3 * Part of WikiCitation extension for Mediawiki.

204 $circaTerms = MagicWord::get( WCDateTermsEnum::$magicWordKeys[ WCDateTermsEnum::circa ] )->getSynonyms();

205 $options = implode( '|', array_merge( $adTerms, $bcTerms, $circaTerms ) );

206 if ( !preg_match_all( '/'. $options . '|\p{N}+|\p{L}+|./uS', $date, $matches ) ) {

207 $this->year = 0;

208 $this->era = WCDateTermsEnum::AD;

SharedPageUrls.php (https://gitlab.com/juanito.abelo/nlmobile) PHP · 736 lines

1 <?php

2

3 class W3_SharedPageUrls

116 $post = get_post($post_id);

117 $matches =array();

118 if ($post && ($post_pages_number = preg_match_all('/\<\!\-\-nextpage\-\-\>/', $post->post_content,$matches))>0) {

119 global $wp_rewrite;

120 $post_pages_number++;

479

480 $request = preg_replace( "|$wp_rewrite->pagination_base/\d+/?$|", '', $request);

481 $request = preg_replace( '|^index\.php|', '', $request);

482 $request = ltrim($request, '/');

483

485

486 if ( $wp_rewrite->using_index_permalinks() && ( $pagenum > 1 || '' != $request ) )

487 $base .= 'index.php/';

488

489 if ( $pagenum > 1 ) {

eztemplatestringoperator.php (https://github.com/GunioRobot/ezpublish.git) PHP · 734 lines

1 <?php

2 /**

3 * File containing the eZTemplateStringOperator class.

44

45 $this->customMap = array ( 'count_words' => array( 'return' => 'int',

46 'code' => '$result = preg_match_all( "#(\w+)#", $staticValues[0], $dummy );'

47 ),

48 'chr' => array( 'return' => 'string',

266 }

267

268 function phpMapTransformation( $operatorName, $node, $tpl, $resourceData,

269 $element, $lastElement, $elementList, $elementTree, &$parameters )

270 {

271 $values = array();

272 $phpFunctionList = explode( ',', $this->phpMap[$operatorName] );

273 foreach ( $phpFunctionList as $element )

AutoLoader.class.php (https://github.com/cj/Project-Pier.git) PHP · 300 lines

1 <?php

2

3 /**

27 * @var string

28 */

29 private $index_filename = 'autoloader_index.php';

30

31 /**

41 * @var string

42 */

43 private $scan_file_extension = 'class.php';

44

45 /**

115 * - Scans the class dirs for class/interface definitions and

116 * creates an associative array (class name => class file)

117 * - Generates the array in PHP code and saves it as index file

118 *

119 * @access private

Path.php (https://gitlab.com/ealexis.t/kiosco) PHP · 529 lines

1 <?php

2 /**

3 * @package php-svg-lib

4 * @link http://github.com/PhenX/php-svg-lib

5 * @author Fabien Ménager <fabien.menager@gmail.com>

6 * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License

39

40 $commands = array();

41 preg_match_all('/([MZLHVCSQTAmzlhvcsqta])([eE ,\-.\d]+)*/', $attribs['d'], $commands, PREG_SET_ORDER);

42

43 $path = array();

45 if (count($c) == 3) {

46 $arguments = array();

47 preg_match_all('/[\-^]?[\d.]+(e[\-]?[\d]+){0,1}/i', $c[2], $arguments, PREG_PATTERN_ORDER);

48

49 $item = $arguments[0];

smarty_internal_compile_section.php (https://gitlab.com/Shenglian/SmartyProject) PHP · 469 lines

1 <?php

2 /**

3 * Smarty Internal Plugin Compile Section

120 $namedAttr = $this->matchResults[ 'named' ];

121 }

122 if (isset($_attr[ 'properties' ]) && preg_match_all("/['](.*?)[']/", $_attr[ 'properties' ], $match)) {

123 foreach ($match[ 1 ] as $prop) {

124 if (in_array($prop, $this->nameProperties)) {

130 }

131 $namedAttr[ 'index' ] = true;

132 $output = "<?php\n";

133 foreach ($_attr as $attr_name => $attr_value) {

134 switch ($attr_name) {

423 $this->openTag($compiler, 'sectionelse', array('sectionelse', $nocache, $local, $sectionVar));

424

425 return "<?php }} else {\n ?>";

426 }

427 }

scope.php (https://github.com/DeprecatedCode/Logical-HTML-PHP.git) PHP · 317 lines

1 <?php

2

3 namespace Evolution\LHTML;

264 if(strpos($content, '{') === false) return array();

265 // parse out the variables

266 preg_match_all(

267 "/{([\w:|.\,\(\)\/\-\% \[\]\?'=]+?)}/", //regex

268 $content, // source

283 if(strpos($content, '[') === false) return array();

284 // parse out the variables

285 preg_match_all(

286 "/\[([\w:|.\,\(\)\/\-\% \[\]\?'=]+?)\]/", //regex

287 $content, // source

301 if(strpos($content, '(') === false) return array();

302 // parse out the variables

303 preg_match_all(

304 "/([\w]+?)\(([\w:|.\,=@\(\)\/\-\%& ]*?)\)/", //regex

305 $content, // source

HeaderBag.php (https://github.com/sebio/symfony.git) PHP · 317 lines

1 <?php

2

3 /*

308 {

309 $cacheControl = array();

310 preg_match_all('#([a-zA-Z][a-zA-Z_-]*)\s*(?:=(?:"([^"]*)"|([^ \t",;]*)))?#', $header, $matches, PREG_SET_ORDER);

311 foreach ($matches as $match) {

312 $cacheControl[strtolower($match[1])] = isset($match[2]) && $match[2] ? $match[2] : (isset($match[3]) ? $match[3] : true);

Request.php (https://gitlab.com/dkatolicky/zacatecnice) PHP · 334 lines

1 <?php

2

3 /**

314 $s = strtr($s, '_', '-'); // cs_CZ means cs-CZ

315 rsort($langs); // first more specific

316 preg_match_all('#(' . implode('|', $langs) . ')(?:-[^\s,;=]+)?\s*(?:;\s*q=([0-9.]+))?#', $s, $matches);

317

318 if (!$matches[0]) {

mysql.class.php (https://gitlab.com/phamngsinh/baitaplon_sinhvien) PHP · 735 lines

1 <?php

2

3 /**

8 */

9

10 if ( defined( 'NV_CLASS_SQL_DB_PHP' ) ) return;

11 define( 'NV_CLASS_SQL_DB_PHP', true );

666 ), $pattern );

667

668 preg_match_all( "/[\s]*[\"|\']*[\s]*\[([s|d])([a]*)\][\s]*[\"|\']*[\s]*/", $pattern, $matches );

669

670 $replacement = func_get_args();

Path.php (https://github.com/trob/fabrik.git) PHP · 528 lines

1 <?php

2 /**

3 * @package php-svg-lib

4 * @link http://github.com/PhenX/php-svg-lib

5 * @author Fabien Ménager <fabien.menager@gmail.com>

6 * @license GNU LGPLv3+ http://www.gnu.org/copyleft/lesser.html

39

40 $commands = array();

41 preg_match_all('/([MZLHVCSQTAmzlhvcsqta])([eE ,\-.\d]+)*/', $attributes['d'], $commands, PREG_SET_ORDER);

42

43 $path = array();

45 if (count($c) == 3) {

46 $arguments = array();

47 preg_match_all('/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:e[-+]?\d+)?)/i', $c[2], $arguments, PREG_PATTERN_ORDER);

48 $item = $arguments[0];

49 $commandLower = strtolower($c[1]);

smarty_internal_compile_section.php (https://github.com/exponentcms/exponent-cms.git) PHP · 462 lines

1 <?php

2 /**

3 * Smarty Internal Plugin Compile Section

121 $namedAttr = $this->matchResults[ 'named' ];

122 }

123 if (isset($_attr[ 'properties' ]) && preg_match_all("/['](.*?)[']/", $_attr[ 'properties' ], $match)) {

124 foreach ($match[ 1 ] as $prop) {

125 if (in_array($prop, $this->nameProperties)) {

131 }

132 $namedAttr[ 'index' ] = true;

133 $output = "<?php\n";

134 foreach ($_attr as $attr_name => $attr_value) {

135 switch ($attr_name) {

422 list($openTag, $nocache, $local, $sectionVar) = $this->closeTag($compiler, array('section'));

423 $this->openTag($compiler, 'sectionelse', array('sectionelse', $nocache, $local, $sectionVar));

424 return "<?php }} else {\n ?>";

425 }

426 }

smarty_internal_compile_foreach.php (https://gitlab.com/Shenglian/SmartyProject) PHP · 330 lines

1 <?php

2 /**

3 * Smarty Internal Plugin Compile Foreach

138 $namedAttr = $this->matchResults[ 'named' ];

139 }

140 if (isset($_attr[ 'properties' ]) && preg_match_all("/['](.*?)[']/", $_attr[ 'properties' ], $match)) {

141 foreach ($match[ 1 ] as $prop) {

142 if (in_array($prop, $this->itemProperties)) {

193 $compiler->nocache = $compiler->nocache | $compiler->tag_nocache;

194 // generate output code

195 $output = "<?php\n";

196 $output .= "\$_from = \$_smarty_tpl->smarty->ext->_foreach->init(\$_smarty_tpl, $from, " .

197 var_export($item, true);

279 list($openTag, $nocache, $local, $itemVar, $restore) = $this->closeTag($compiler, array('foreach'));

280 $this->openTag($compiler, 'foreachelse', array('foreachelse', $nocache, $local, $itemVar, 0));

281 $output = "<?php\n";

282 if ($restore == 2) {

283 $output .= "{$itemVar} = {$local}saved;\n";

commentsTemplate.php (https://gitlab.com/morganestes/wordpress-develop) PHP · 916 lines

1 <?php

2

3 /**

36

37 // Life in the fast lane.

38 $comments = preg_match_all( '/id="comment-([0-9]+)"/', $found, $matches );

39

40 $found_cids = array_map( 'intval', $matches[1] );

70

71 // Life in the fast lane.

72 $comments = preg_match_all( '/id="comment-([0-9]+)"/', $found, $matches );

73

74 $found_cids = array_map( 'intval', $matches[1] );

104

105 // Life in the fast lane.

106 $comments = preg_match_all( '/id="comment-([0-9]+)"/', $found, $matches );

107

108 $found_cids = array_map( 'intval', $matches[1] );

SharedPageUrls.php (https://bitbucket.org/millien/illien.ch-wordpress.git) PHP · 736 lines

1 <?php

2

3 class W3_SharedPageUrls

116 $post = isset($post)? $post: get_post($post_id);

117 $matches =array();

118 if (($post_pages_number = preg_match_all('/\<\!\-\-nextpage\-\-\>/', $post->post_content,$matches))>0) {

119 global $wp_rewrite;

120 $post_pages_number++;

479

480 $request = preg_replace( "|$wp_rewrite->pagination_base/\d+/?$|", '', $request);

481 $request = preg_replace( '|^index\.php|', '', $request);

482 $request = ltrim($request, '/');

483

485

486 if ( $wp_rewrite->using_index_permalinks() && ( $pagenum > 1 || '' != $request ) )

487 $base .= 'index.php/';

488

489 if ( $pagenum > 1 ) {

restorelib.php (https://github.com/galitush2005/RTL-BIDI-Hebrew-Moodle-Plugins.git) PHP · 243 lines

1 <?php

2

3 function lightboxgallery_restore_mods($mod, $restore) {

118

119 $searchstring = '/\$@(GALLERYINDEX)\*([0-9]+)@\$/';

120 preg_match_all($searchstring, $content, $foundset);

121 if ($foundset[0]) {

122 foreach ($foundset[2] as $old_id) {

124 $searchstring = '/\$@(GALLERYINDEX)\*('.$old_id.')@\$/';

125 if (!empty($rec->new_id)) {

126 $result = preg_replace($searchstring, $CFG->wwwroot.'/mod/lightboxgallery/index.php?id='.$rec->new_id, $result);

127 } else {

128 $result = preg_replace($searchstring, $restore->original_wwwroot.'/mod/lightboxgallery/index.php?id='.$old_id, $result);

132

133 $searchstring = '/\$@(GALLERYVIEWBYID)\*([0-9]+)@\$/';

134 preg_match_all($searchstring, $result, $foundset);

135 if ($foundset[0]) {

136 foreach($foundset[2] as $old_id) {

CoreExtension.php (https://github.com/herdani/snowcap-website.git) PHP · 218 lines

1 <?php

2 namespace Snowcap\SiteBundle\Twig\Extension;

3

119 private function closetags($html)

120 {

121 preg_match_all('#<([a-z]+)(?: .*)?(?<![/|/ ])>#iU', $html, $result);

122 $openedtags = $result[1]; #put all closed tags into an array

123

124 preg_match_all('#</([a-z]+)>#iU', $html, $result);

125 $closedtags = $result[1];

126

Util_PageUrls.php (https://gitlab.com/karlen/ayo_wp) PHP · 788 lines

1 <?php

2 namespace W3TC;

3

99 $post = get_post( $post_id );

100 $matches =array();

101 if ( $post && ( $post_pages_number = preg_match_all( '/\<\!\-\-nextpage\-\-\>/', $post->post_content, $matches ) )>0 ) {

102 global $wp_rewrite;

103 $post_pages_number++;

496

497 $request = preg_replace( "|$wp_rewrite->pagination_base/\d+/?$|", '', $request );

498 $request = preg_replace( '|^index\.php|', '', $request );

499 $request = ltrim( $request, '/' );

500

502

503 if ( $wp_rewrite->using_index_permalinks() && ( $pagenum > 1 || '' != $request ) )

504 $base .= 'index.php/';

505

506 if ( $pagenum > 1 ) {

sitemailer_.php (https://gitlab.com/nvtdn2006/azora) PHP · 384 lines

1 <?php

2 class SiteMailer

3 {

51

52 $this->headers .= "MIME-Version: 1.0\r\n";

53 //$this->headers .= "Content-Type: multipart/mixed; boundary=\"PHP-mixed-" . $this->randomHash . "\"\r\n";

54 $this->headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";

55 }

89 /*if ($this->attachment != '')

90 {

91 $this->msgBody .= "\r\n--PHP-mixed-" . $this->randomHash . "--";

92 $this->msgBody .= $this->attachment;

93 $this->msgBody .= "\r\n--PHP-mixed-" . $this->randomHash . "--";

155

156 private function sendActivationToCustomer($property) {

157 /*$htmlCT = "--PHP-alt-" . $this->randomHash . "\r\n";

158 $htmlCT .= 'Content-Type: text/html; charset="iso-8859-1"' . "\r\n";

159 $htmlCT .= 'Content-Transfer-Encoding: 7bit' . "\r\n";*/

MY_Parser.php (https://github.com/fredquie/pyrocms.git) PHP · 273 lines

1 <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

2 /**

3 * CodeIgniter

4 *

5 * An open source application development framework for PHP 4.3.2 or newer

6 *

7 * @package CodeIgniter

113 $pattern = sprintf($pattern, $this->l_delim, $this->helper_delim, $this->func_l_delim, $this->func_r_delim, $this->r_delim);

114

115 preg_match_all($pattern, $template, $matches);

116

117 $matches_count = count($matches[0]);

164 $CI =& get_instance();

165

166 // If there is a helper file (not a native PHP function) and it has not yet been loaded

167 if(!empty($helper) && !array_key_exists($helper, $CI->load->_ci_helpers))

168 {

KalturaDocCommentParser.php (https://github.com/richhl/kalturaCE.git) PHP · 243 lines

1 <?php

2 /**

3 * @ignore

176

177 $result = null;

178 if (preg_match_all( self::DOCCOMMENT_DESCRIPTION, $comment, $result ))

179 $this->description = preg_replace("/(\\*\\s*)/", "", implode("\n", $result[0]));

180

221 $result = null;

222 $error_array = array();

223 if (preg_match_all(self::DOCCOMMENT_ACTION_ERRORS, $comment, $result))

224 {

225 foreach($result[1] as $index => $errorClass)

TableTest.php (https://gitlab.com/DEVLINE/magento2.git) PHP · 213 lines

1 <?php

2 /**

3 * Copyright © 2015 Magento. All rights reserved.

10 namespace Magento\Test\Legacy;

11

12 class TableTest extends \PHPUnit_Framework_TestCase

13 {

14 public function testTableName()

33 $this->assertEmpty($message, $message);

34 },

35 \Magento\Framework\Test\Utility\Files::init()->getPhpFiles()

36 );

37 }

51 foreach ($regexpMethods as $method) {

52 $regexp = self::$method($filePath);

53 if (!preg_match_all($regexp, $content, $matches, PREG_SET_ORDER)) {

54 continue;

55 }

smarty_internal_compile_extends.php (https://github.com/basdog22/Qool.git) PHP · 128 lines

1 <?php

2

3 /**

79 $compiler->template->properties['file_dependency'][$template_sha1] = array($_template->source->filepath, $_template->source->timestamp, $_template->source->type);

80 $_content = ($this->mbstring_overload ? mb_substr($compiler->template->source->content, $compiler->lex->counter - 1, 20000000, 'latin1') : substr($compiler->template->source->content, $compiler->lex->counter - 1));

81 if (preg_match_all("!({$this->_ldl}block\s(.+?){$this->_rdl})!", $_content, $s) !=

82 preg_match_all("!({$this->_ldl}/block{$this->_rdl})!", $_content, $c)) {

83 $compiler->trigger_template_error('unmatched {block} {/block} pairs');

84 }

85 preg_match_all("!{$this->_ldl}block\s(.+?){$this->_rdl}|{$this->_ldl}/block{$this->_rdl}|{$this->_ldl}\*([\S\s]*?)\*{$this->_rdl}!", $_content, $_result, PREG_OFFSET_CAPTURE);

86 $_result_count = count($_result[0]);

87 $_start = 0;

StemmerComponent.php (https://gitlab.com/potiev/machine-learning) PHP · 413 lines

1 <?php

2

3 namespace app\components;

4

5 /**

6 * Copyright (c) 2005 Richard Heyes (http://www.phpguru.org/)

7 *

8 * All rights reserved.

12

13 /**

14 * PHP5 Implementation of the Porter Stemmer algorithm. Certain elements

15 * were borrowed from the (broken) implementation by Jon Abernathy.

16 *

372 $str = preg_replace("#$v+$#", '', $str);

373

374 preg_match_all("#($v+$c+)#", $str, $matches);

375

376 return count($matches[1]);

HeaderBag.php (https://gitlab.com/xolotsoft/pumasruiz) PHP · 348 lines

1 <?php

2

3 /*

339 {

340 $cacheControl = array();

341 preg_match_all('#([a-zA-Z][a-zA-Z_-]*)\s*(?:=(?:"([^"]*)"|([^ \t",;]*)))?#', $header, $matches, PREG_SET_ORDER);

342 foreach ($matches as $match) {

343 $cacheControl[strtolower($match[1])] = isset($match[3]) ? $match[3] : (isset($match[2]) ? $match[2] : true);

eztemplatestringoperator.php (https://github.com/lserwatka/ezpublish.git) PHP · 754 lines

1 <?php

2 //

3 // Definition of eZTemplateStringOperator class

64

65 $this->customMap = array ( 'count_words' => array( 'return' => 'int',

66 'code' => '$result = preg_match_all( "#(\w+)#", $staticValues[0], $dummy );'

67 ),

68 'chr' => array( 'return' => 'string',

286 }

287

288 function phpMapTransformation( $operatorName, $node, $tpl, $resourceData,

289 $element, $lastElement, $elementList, $elementTree, &$parameters )

290 {

291 $values = array();

292 $phpFunctionList = explode( ',', $this->phpMap[$operatorName] );

293 foreach ( $phpFunctionList as $element )

Signature.php (https://github.com/miamiruby/cakestuff.git) PHP · 179 lines

1 <?php

2

3 class ZendL_Tool_Rpc_Provider_Signature

149

150 if (($docComment = $method->getDocComment()) != '' &&

151 (preg_match_all('/@param\s+(\w+)+\s+(\$\S+)\s+(.*?)(?=(?:\*\s*@)|(?:\*\/))/s', $docComment, $matches)))

152 {

153 for ($i=0; $i <= count($matches[0])-1; $i++) {

modifier.truncate.php (https://github.com/mcrider/pkpUpgradeTestSuite.git) PHP · 244 lines

1 <?php

2 /**

3 * Smarty plugin

15 * optionally splitting in the middle of a word, and

16 * appending the $etc string or inserting $etc into the middle.

17 * @link http://smarty.php.net/manual/en/language.modifier.truncate.php

18 * truncate (Smarty online manual)

19 * @author Monte Ohrt <monte at ohrt dot com> with modifications by Matthew Crider (mcrider at sfu dot ca)

201 function close_tags($string, $open = false){

202 //put all opened tags into an array

203 preg_match_all("#<([a-z]+)( .*)?(?!/)>#iU",$string,$result);

204 $openedtags=$result[1];

205

206 //put all closed tags into an array

207 preg_match_all("#</([a-z]+)>#iU",$string,$result);

208 $closedtags = $result[1];

209 $len_opened = count($openedtags);

PorterStemmer.php (https://github.com/shin2/concrete5.git) PHP · 411 lines

1 <?php

2 /**

3 * Copyright (c) 2005 Richard Heyes (http://www.phpguru.org/)

9

10 /**

11 * PHP5 Implementation of the Porter Stemmer algorithm. Certain elements

12 * were borrowed from the (broken) implementation by Jon Abernathy.

13 *

370 $str = preg_replace("#$v+$#", '', $str);

371

372 preg_match_all("#($v+$c+)#", $str, $matches);

373

374 return count($matches[1]);

smarty_internal_compile_extends.php (https://github.com/pws5068/RSNCorp.git) PHP · 110 lines

1 <?php

2

3 /**

38 $compiler->template->properties['file_dependency'][sha1($_template->getTemplateFilepath())] = array($_template->getTemplateFilepath(), $_template->getTemplateTimestamp());

39 $_content = $compiler->template->template_source;

40 if (preg_match_all("!({$this->_ldl}block(.+?){$this->_rdl})!", $_content, $s) !=

41 preg_match_all("!({$this->_ldl}/block(.*?){$this->_rdl})!", $_content, $c)) {

42 $this->compiler->trigger_template_error('unmatched {block} {/block} pairs');

43 }

44 preg_match_all("!{$this->_ldl}block(.+?){$this->_rdl}|{$this->_ldl}/block.*{$this->_rdl}!", $_content, $_result, PREG_OFFSET_CAPTURE);

45 $_result_count = count($_result[0]);

46 $_start = 0;

Autoloader.php (https://github.com/jasondavis/Framework.git) PHP · 173 lines

1 <?php

2 /**

3 * A simple yet powerful namespace based autoloader for php.

14 * This will autoload all classes that begin with the namespace MyNameSpace to that directory using

15 * the remainder of the namespace to figure out the path. That is, using the autoloader setup from

16 * above, the class '\MyNameSpace\Admin\User' would map to '/path/to/namespace/root/Admin/User.php'.

17 *

18 * <h4>Mutltiple Directories Per Namespace</h4>

42 * | -> Admin

43 * | -> controllers

44 * | -> Home.php (class: \MyProject\Admin\Home)

45 * | -> AccessControl.php (class: \MyProject\Admin\AccessControl)

57 *

58 * If you now tried to autoload the \MyProject\Admin\AccessControl is would now map to the directory

59 * '/path/to/MyProject/modules/Admin/controllers/AccessControl.php' instead of

60 * '/path/to/MyProject/modules/Admin/AccessControl.php'.

custom_fields.php (https://gitlab.com/Gashler/sg) PHP · 218 lines

1 <?php

2

3 function _wpr_custom_fields_handler()

55 $query = "UPDATE `".$wpdb->prefix."wpr_custom_fields` SET `type`='$type',`label`='$label',`enum`='$enum' where id='$cid';" ;

56 $wpdb->query($query);

57 wp_redirect("admin.php?page=_wpr/custom_fields&cfact=manage&nid=$nid");

58 exit;

59 }

103 $enum='';

104 }

105 preg_match_all("@[^a-z0-9_]@",$name,$match);

106

107

135 $wpdb->query($theQuery);

136 }

137 wp_redirect("admin.php?page=_wpr/custom_fields&cfact=manage&nid=$nid");

138 exit;

139 }

Parser.php (https://github.com/humansky/qframe.git) PHP · 219 lines

1 <?php

2 /**

3 * This file is part of the CSI SIG.

24

25 /** Haml_Line */

26 require_once 'Haml/Line.php';

27

28

29 /** Haml_Element */

30 require_once 'Haml/Element.php';

31

32

33 /** Haml_Prolog */

34 require_once 'Haml/Prolog.php';

35

36

utf8_functions.php (https://gitlab.com/truongdacngoc1993/tuanviet.git) PHP · 303 lines

1 <?php

2

3 /**

136 }

137

138 preg_match_all( '/.{' . $split_len . '}|[^\x00]{1,' . $split_len . '}$/us', $str, $ar );

139 return $ar[0];

140 }

245 function nv_EncString( $string )

246 {

247 if( file_exists( NV_ROOTDIR . '/includes/utf8/lookup_' . NV_LANG_DATA . '.php' ) )

248 {

249 include NV_ROOTDIR . '/includes/utf8/lookup_' . NV_LANG_DATA . '.php' ;

251 }

252

253 include NV_ROOTDIR . '/includes/utf8/lookup.php' ;

254 return strtr( $string, $utf8_lookup['romanize'] );

255 }

Conditions.php (https://gitlab.com/yousafsyed/easternglamor) PHP · 259 lines

1 <?php

2 /**

3 * Copyright © 2016 Magento. All rights reserved.

245 private function parseCondition($condition)

246 {

247 if (!preg_match_all('/([^|]+\|?)/', $condition, $match)) {

248 throw new \Exception('Bad format condition');

249 }

Differ.php (https://gitlab.com/techniconline/kmc) PHP · 257 lines

1 <?php

2 /*

3 * This file is part of the Diff package.

4 *

5 * (c) Sebastian Bergmann <sebastian@phpunit.de>

6 *

7 * For the full copyright and license information, please view the LICENSE

19 *

20 * @package Diff

21 * @author Sebastian Bergmann <sebastian@phpunit.de>

22 * @author Kore Nordmann <mail@kore-nordmann.de>

23 * @copyright Sebastian Bergmann <sebastian@phpunit.de>

132 public function diffToArray($from, $to, LongestCommonSubsequence $lcs = null)

133 {

134 preg_match_all('(\r\n|\r|\n)', $from, $fromMatches);

135 preg_match_all('(\r\n|\r|\n)', $to, $toMatches);

portfolio_m.php (https://github.com/jenkoian/pyrocms-portfolio.git) PHP · 264 lines

1 <?php

2

3 defined('BASEPATH') OR exit('No direct script access allowed');

232 $matches = array();

233 if (strstr($data['keywords'], '%')) {

234 preg_match_all('/%.*?%/i', $data['keywords'], $matches);

235 }

236

ShellAbstract.php (https://bitbucket.org/jokusafet/magento2.git) PHP · 206 lines

1 <?php

2 /**

3 * Magento

8 * that is bundled with this package in the file LICENSE.txt.

9 * It is also available through the world-wide-web at this URL:

10 * http://opensource.org/licenses/osl-3.0.php

11 * If you did not receive a copy of the license and are unable to

12 * obtain it through the world-wide-web, please send an email

108 $data = file_get_contents($htaccess);

109 $matches = array();

110 preg_match_all('#^\s+?php_value\s+([a-z_]+)\s+(.+)$#siUm', $data, $matches, PREG_SET_ORDER);

111 if ($matches) {

112 foreach ($matches as $match) {

114 }

115 }

116 preg_match_all('#^\s+?php_flag\s+([a-z_]+)\s+(.+)$#siUm', $data, $matches, PREG_SET_ORDER);

117 if ($matches) {

118 foreach ($matches as $match) {

pcre.php (https://gitlab.com/wendy-du-973/club-invest-gr2) PHP · 659 lines

1 <?php

2

3 namespace Safe;

348 *

349 */

350 function preg_match_all(string $pattern, string $subject, array &$matches = null, int $flags = PREG_PATTERN_ORDER, int $offset = 0): int

351 {

352 error_clear_last();

353 $result = \preg_match_all($pattern, $subject, $matches, $flags, $offset);

354 if ($result === false) {

355 throw PcreException::createFromPhpError();

590 $result = \preg_match($pattern, $subject, $matches, $flags, $offset);

591 if ($result === false) {

592 throw PcreException::createFromPhpError();

593 }

594 return $result;

config-validator.php (https://gitlab.com/webkod3r/tripolis) PHP · 286 lines

1 <?php

2

3 class WPCF7_ConfigValidator {

209

210 if ( ! empty( $values ) ) {

211 preg_match_all( '/"[^"]*"|\'[^\']*\'/', $values, $matches );

212 $values = wpcf7_strip_quote_deep( $matches[0] );

213 }

smarty_internal_compile_private_print_expression.php (https://github.com/CmmTech/Task-Management-System.git) PHP · 156 lines

1 <?php

2 /**

3 * Smarty Internal Plugin Compile Print Expression

57 if (isset($_attr['assign'])) {

58 // assign output to variable

59 $output = "<?php \$_smarty_tpl->assign({$_attr['assign']},{$parameter['value']});?>";

60 } else {

61 // display value

71 $modifierlist = array();

72 foreach ($compiler->smarty->default_modifiers as $key => $single_default_modifier) {

73 preg_match_all('/(\'[^\'\\\\]*(?:\\\\.[^\'\\\\]*)*\'|"[^"\\\\]*(?:\\\\.[^"\\\\]*)*"|:|[^:]+)/', $single_default_modifier, $mod_array);

74 for ($i = 0, $count = count($mod_array[0]);$i < $count;$i++) {

75 if ($mod_array[0][$i] != ':') {

122

123 $compiler->has_output = true;

124 $output = "<?php echo {$output};?>";

125 }

126 return $output;

router.php (https://bitbucket.org/slogsdon/unamed.git) PHP · 264 lines

1 <?php

2 /**

3 * Unamed - a WordPress replacement

90 *

91 * Compiles a route string to a regular expression

92 * lifted from https://github.com/chriso/klein.php because i hate

93 * dealing with regex

94 *

99 protected function compileRoute($route)

100 {

101 if (preg_match_all(

102 '`(/|\.|)\[([^:\]]*+)(?::([^:\]]*+))?\](\?|)`',

103 $route,

177 protected function parseUri()

178 {

179 $path = rtrim(parse_url($this->request->uri, PHP_URL_PATH), '/');

180 if (!is_null($this->basePath)) {

181 if (strpos($path, $this->basePath) === 0) {

porteren.php (https://github.com/pjwiseman/joomla-cms.git) PHP · 449 lines

1 <?php

2 /**

3 * @package Joomla.Platform

5 *

6 * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.

7 * @copyright Copyright (C) 2005 Richard Heyes (http://www.phpguru.org/). All rights reserved.

8 * @license GNU General Public License version 2 or later; see LICENSE

9 */

403 $str = preg_replace("#$v+$#", '', $str);

404

405 preg_match_all("#($v+$c+)#", $str, $matches);

406

407 return count($matches[1]);

report.php (https://github.com/fmake/adv.git) PHP · 197 lines

1 <?php

2 /**

3 *

104 $reportLinks -> addParam("pr",$links[$i]['page_pr']);

105 $reportLinks -> addParam("link", mysql_real_escape_string( $links[$i]['site_url'].$links[$i]['page_uri'] ) );

106 preg_match_all("/#a#(.+)#\/a#/iU", $links[$i]['txt'], $anchor);

107 $reportLinks -> addParam("anchor",mysql_real_escape_string($anchor[1][0]));

108 $reportLinks -> addParam("txt",$links[$i]['txt']);

options.php (https://bitbucket.org/newsinc/wordpressplugin.git) PHP · 97 lines

1 <div class="wrap">

2 <?php screen_icon(); ?>

3 <h2>NDN embed code conversion</h2>

4

5 <?php

6 if($_POST['submit'] && $_POST['embedcode']){

7

18 $str = preg_replace('/[^\w-:;=?&\/ ]/', '', $str);

19 $str = preg_replace('/[&?]/',' ',$str);

20 preg_match_all("/([^,= ]+)=([^,= ]+)/", $str, $r);

21 if ($r[1] && $r[2]){

22 $result = array_combine($r[1], $r[2]);

54 $str = substr($str,0,strpos($str,">"));

55 $str = preg_replace('/[^\w-:;=\/ ]/', '', $str);

56 preg_match_all("/([^,= ]+)=([^,= ]+)/", $str, $r);

57 if ($r[1] && $r[2]){

58 $result = array_combine($r[1], $r[2]);

parser.php (https://github.com/Yacodo/atoum.git) PHP · 190 lines

1 <?php

2

3 namespace mageekguy\atoum\template;

119 $currentTag->addChild($child);

120

121 if (preg_match_all('%(\w+)="([^"]*)"%', $tag[3][0], $attributes) == true)

122 {

123 foreach ($attributes[1] as $index => $attribute)

DefaultComplexType.php (https://github.com/jtai/zf2.git) PHP · 108 lines

1 <?php

2 /**

3 * Zend Framework

47 *

48 * @param string $type Name of the class to be specified

49 * @return string XSD Type for the given PHP type

50 */

51 public function addComplexType($type)

82

83 foreach ($class->getProperties() as $property) {

84 if ($property->isPublic() && preg_match_all('/@var\s+([^\s]+)/m', $property->getDocComment(), $matches)) {

85

86 /**

Route.php (https://gitlab.com/szlongshu/manaphp) PHP · 225 lines

1 <?php

2

3 namespace ManaPHP\Mvc\Router {

4

5 /**

6 * ManaPHP\Mvc\Router\Route

7 *

8 * This class represents every route added to the router

9 *

10 * NOTE_PHP:

11 * Hostname Constraints has been removed by PHP implementation

35

36 /**

37 * \ManaPHP\Mvc\Router\Route constructor

38 *

39 * @param string $pattern

Service.php (https://github.com/rukavina/Octopus.git) PHP · 231 lines

1 <?php

2

3 /**

172 $matches = array();

173 $regex = "/([0-9]{2})\/([0-9]{2}) ([0-9]{2})\:([0-9]{2})\:([0-9]{2}) ([T,R]x) ([PL|RF]{2}) House(Unit)*: ([A-F]{1})([0-9]{0,2})( Func: (.*))*/";

174 $matchResult = preg_match_all($regex, $text, $matches, PREG_SET_ORDER);

175 echo "\nMatch result: $matchResult\n";

176 if($matchResult > 0){

smarty_internal_compile_private_foreachsection.php (https://gitlab.com/garabedian.kevin/web2TB) PHP · 221 lines

1 <?php

2 /**

3 * Smarty Internal Plugin Compile ForeachSection

138 public function matchProperty($source)

139 {

140 preg_match_all($this->propertyPreg, $source, $match, PREG_SET_ORDER);

141 foreach ($this->resultOffsets as $key => $offset) {

142 foreach ($match as $m) {

part_parser.php (https://github.com/ksecor/civicrm.git) PHP · 206 lines

1 <?php

2 /**

3 * File containing the ezcMailPartParser class

84 $matches = array();

85 // matches "type/subtype; blahblahblah"

86 preg_match_all( '/^(\S+)\/([^;]+)/',

87 $headers['Content-Type'], $matches, PREG_SET_ORDER );

88 if ( count( $matches ) > 0 )

173 {

174 $matches = array();

175 preg_match_all( "/^([\w-_]*):\s?(.*)/", $line, $matches, PREG_SET_ORDER );

176 if ( count( $matches ) > 0 )

177 {

class.t3lib_utility_math.php (https://github.com/itag/TYPO3v4-Core.git) PHP · 174 lines

1 <?php

2 /***************************************************************

3 * Copyright notice

100 // split the expression here:

101 $reg = array();

102 preg_match_all('/' . $regex . '/', $string, $reg);

103

104 reset($reg[2]);

smarty_internal_resource_extends.php (https://github.com/SquattingSasquatches/Lucidity.git) PHP · 148 lines

1 <?php

2 /**

3 * Smarty Internal Plugin Resource Extends

33 foreach ($components as $component) {

34 $s = Smarty_Resource::source(null, $source->smarty, $component);

35 if ($s->type == 'php') {

36 throw new SmartyException("Resource type {$s->type} cannot be used with the extends resource type");

37 }

98 // extend sources

99 if ($_component != $_last) {

100 if (preg_match_all("!({$_ldl}block\s(.+?){$_rdl})!", $_content, $_open) !=

101 preg_match_all("!({$_ldl}/block{$_rdl})!", $_content, $_close)) {

102 throw new SmartyException("unmatched {block} {/block} pairs in template {$_component->type} '{$_component->name}'");

103 }

104 preg_match_all("!{$_ldl}block\s(.+?){$_rdl}|{$_ldl}/block{$_rdl}|{$_ldl}\*([\S\s]*?)\*{$_rdl}!", $_content, $_result, PREG_OFFSET_CAPTURE);

105 $_result_count = count($_result[0]);

106 $_start = 0;

DidYouMean.hooks.php (https://github.com/ChuguluGames/mediawiki-svn.git) PHP · 195 lines

1 <?php

2 /**

3 * All the hooks for DidYouMean

56 wfDebug( "HIPP: xsee Hit\n" );

57 $hasTemplate = true;

58 preg_match_all( "/\|\[\[([^]|]*)(?:\|([^|]*))?\]\](?: \(([^)]*)\))?/", $see[1], $ma );

59 $sees = $ma[1];

60 } else {

Query.php (https://github.com/massiveart/ZF-ZOOLU.git) PHP · 223 lines

1 <?php

2 /**

3 * Zend Framework

17 * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)

18 * @license http://framework.zend.com/license/new-bsd New BSD License

19 * @version $Id: Query.php 20096 2010-01-06 02:05:09Z bkarwin $

20 */

21

23 * @see Zend_Dom_Query_Css2Xpath

24 */

25 require_once 'Zend/Dom/Query/Css2Xpath.php';

26

27 /**

28 * @see Zend_Dom_Query_Result

29 */

30 require_once 'Zend/Dom/Query/Result.php';

31

32 /**

Form.php (https://bitbucket.org/wl-framework-dev/weblab-framework.git) PHP · 403 lines

1 <?php

2 /**

3 * Form.php

349 $value = isset( $resp[ $name ] ) ? $resp[ $name ] : null;

350

351 preg_match_all( '#\[([^\]]+)\]#', $field, $matches, PREG_SET_ORDER );

352

353 foreach( $matches as $match ) {

missing-php-functions.php (https://bitbucket.org/adatux_/uakami.git) PHP · 153 lines

1 <?php

2

3 // json_decode

4 if ( !function_exists('json_decode') ){

5 include_once ICL_PLUGIN_PATH . '/lib/JSON.php';

6 function json_decode($data, $bool) {

7 if ($bool) {

29 return $mu_plugins;

30 while ( ( $plugin = readdir( $dh ) ) !== false ) {

31 if ( substr( $plugin, -4 ) == '.php' )

32 $mu_plugins[] = WPMU_PLUGIN_DIR . '/' . $plugin;

33 }

46

47 The function accepts to same string of format accepts for the

48 original function of the PHP.

49

50 (Sorry. my writing in English is very bad)

OutputFormatter.php (https://github.com/Sa-ryong/Stadioom-php.git) PHP · 185 lines

1 <?php

2

3 /*

164 private function createStyleFromString($string)

165 {

166 if (!preg_match_all('/([^=]+)=([^;]+)(;|$)/', strtolower($string), $matches, PREG_SET_ORDER)) {

167 return false;

168 }

Query.php (https://github.com/sas05/zf-1.11.x-doctrine-2.x.git) PHP · 314 lines

1 <?php

2 /**

3 * Zend Framework

17 * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)

18 * @license http://framework.zend.com/license/new-bsd New BSD License

19 * @version $Id: Query.php 23775 2011-03-01 17:25:24Z ralph $

20 */

21

23 * @see Zend_Dom_Query_Css2Xpath

24 */

25 require_once 'Zend/Dom/Query/Css2Xpath.php';

26

27 /**

28 * @see Zend_Dom_Query_Result

29 */

30 require_once 'Zend/Dom/Query/Result.php';

31

32 /**

CrawlData.php (https://gitlab.com/alanmtk/sube-backend) PHP · 175 lines

1 <?php

2

3 namespace App\Console\Commands;

155 foreach ($result['d'] as $venue) {

156 $tmp = json_decode($venue);

157 preg_match_all("#<b.*?>([^<]+)</b>#", $tmp->Direccion, $data);

158

159 Venue::create([

MY_array_helper.php (https://github.com/rodrigowebe/FUEL-CMS.git) PHP · 173 lines

1 <?php if (!defined('BASEPATH')) exit('No direct script access allowed');

2 /**

3 * FUEL CMS

157 function parse_string_to_array($str)

158 {

159 preg_match_all('#(\w+)=([\'"])(.*)\\2#U', $str, $matches);

160 $params = array();

161 foreach($matches[1] as $key => $val)

170 }

171

172 /* End of file MY_array_helper.php */

173 /* Location: ./application/helpers/MY_array_helper.php */

Pattern.class.php (https://github.com/treuter/xp-framework.git) PHP · 182 lines

1 <?php

2 /* This class is part of the XP framework

3 *

11 *

12 * @test xp://net.xp_framework.unittest.text.PatternTest

13 * @see php://preg

14 * @purpose Regular Expression

15 */

124 public function match($input) {

125 if ($input instanceof String) {

126 $n= preg_match_all($this->regex, (string)$input->getBytes($this->utf8 ? 'utf-8' : 'iso-8859-1'), $m, PREG_SET_ORDER);

127 } else {

128 $n= preg_match_all($this->regex, (string)$input, $m, PREG_SET_ORDER);

CssSplitter.php (https://gitlab.com/A.Julien/sendstockbymail-module-prestashop) PHP · 254 lines

1 <?php

2 /**

3 * PHP CSS Splitter

4 *

5 * Based on https://github.com/zweilove/css_splitter but written for PHP

6 *

7 * @homepage http://www.github.com/dlundgren/php-css-splitter

146

147 // catch all @feature {...} blocks

148 if (preg_match_all('/(@[^{]+){([^{}]*{[^}]*})*\s*}/ism', $css, $matches, PREG_OFFSET_CAPTURE) > 0) {

149 foreach ($matches[0] as $key => $match) {

150 $atRule = trim($matches[1][$key][0]);

transliteration.inc (https://github.com/tomm/drupal-indymedia-alba.git) Pascal · 209 lines

1 <?php

2

3 /**

67 // be handled much more quickly. Don't chop up Unicode areas for punctuation,

68 // though, that wastes energy.

69 preg_match_all('/[\x00-\x7f]+|[\x80-\xff][\x00-\x40\x5b-\x5f\x7b-\xff]*/', $string, $matches);

70

71 $result = '';

82 // normalized.

83 //

84 // Since PHP is not the fastest language on earth, some of this code is a

85 // little ugly with inner loop optimizations.

86

186

187 if (!isset($map[$bank][$langcode])) {

188 $file = drupal_get_path('module', 'transliteration') . '/data/' . sprintf('x%02x', $bank) . '.php';

189 if (file_exists($file)) {

190 include $file;

I18nBehaviorObjectBuilderModifier.php (https://github.com/1989gaurav/Propel.git) PHP · 208 lines

158 'comment' => $comment,

159 'functionStatement' => $functionStatement,

160 'columnPhpName' => $column->getPhpName(),

161 'params' => implode(', ', $params[0]),

162 ));

180 }

181 $comment = preg_replace('/^\t/m', '', $comment);

182 $comment = str_replace('@return ' . $i18nTablePhpName, '@return ' . $tablePhpName, $comment);

183 $functionStatement = preg_replace('/^\t/m', '', $functionStatement);

184 preg_match_all('/\$[a-z]+/i', $functionStatement, $params);

186 'comment' => $comment,

187 'functionStatement' => $functionStatement,

188 'columnPhpName' => $column->getPhpName(),

189 'params' => implode(', ', $params[0]),

190 ));

Router.php (https://github.com/klj613/klj613micromvc.git) PHP · 207 lines

1 <?php

2 /**

3 * This file is part of klj613's micro MVC framework made out of boredom.

91 $regex = '#{([^/]+)}#';

92

93 preg_match_all($regex, $pattern, $matchedKeys);

94

95 $derivedRegex = preg_replace($regex, '([^/]+)', $pattern);

96 preg_match_all('#' . $derivedRegex . '#', $uri, $matchedValues);

97

98 $structure = $this->getParamsStructure($routeId);

Data.php (https://bitbucket.org/jokusafet/magento2.git) PHP · 117 lines

1 <?php

2 /**

3 * Magento

8 * that is bundled with this package in the file LICENSE.txt.

9 * It is also available through the world-wide-web at this URL:

10 * http://opensource.org/licenses/osl-3.0.php

11 * If you did not receive a copy of the license and are unable to

12 * obtain it through the world-wide-web, please send an email

22 * @package Mage_GoogleShopping

23 * @copyright Copyright (c) 2012 X.commerce, Inc. (http://www.magentocommerce.com)

24 * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)

25 */

26

100

101 // parse not well-formatted xml

102 preg_match_all('/(reason|field|type)=\"([^\"]+)\"/', $row, $matches);

103

104 if (is_array($matches) && count($matches) == 3) {

blog_m.php (https://github.com/arimogi/Chimera.git) PHP · 253 lines

1 <?php defined('BASEPATH') OR exit('No direct script access allowed');

2

3 class Blog_m extends MY_Model {

212 if (strstr($data['keywords'], '%'))

213 {

214 preg_match_all('/%.*?%/i', $data['keywords'], $matches);

215 }

216

curl.php (https://github.com/rashmigandhe/HHMobile.git) PHP · 144 lines

1 <?php

2

3 # Curl, CurlResponse

8 # A basic CURL wrapper for PHP

9 #

10 # See the README for documentation/examples or http://php.net/curl for more information about the libcurl extension for PHP

11

12 class Curl

27 $this->user_agent = isset($_SERVER['HTTP_USER_AGENT']) ?

28 $_SERVER['HTTP_USER_AGENT'] :

29 'Curl/PHP ' . PHP_VERSION . ' (http://github.com/shuber/curl/)';

30 }

31

118 # Extract headers from response

119 $pattern = '#HTTP/\d\.\d.*?$.*?\r\n\r\n#ims';

120 preg_match_all($pattern, $response, $matches);

121 $headers = explode("\r\n", str_replace("\r\n\r\n", '', array_pop($matches[0])));

122

core.write_cache_file.php (https://github.com/mrbmc/erector.git) PHP · 96 lines

1 <?php

2 /**

3 * Smarty plugin

33

34 // collapse nocache.../nocache-tags

35 if (preg_match_all('!\{(/?)nocache\:[0-9a-f]{32}#\d+\}!', $params['results'], $match, PREG_PATTERN_ORDER)) {

36 // remove everything between every pair of outermost noache.../nocache-tags

37 // and replace it by a single nocache-tag

86 $_cache_file = $smarty->_get_auto_filename($smarty->cache_dir, $params['tpl_file'], $_auto_id);

87 $_params = array('filename' => $_cache_file, 'contents' => $params['results'], 'create_dirs' => true);

88 require_once(SMARTY_CORE_DIR . 'core.write_file.php');

89 smarty_core_write_file($_params, $smarty);

90 return true;

SQ_Frontend.php (https://gitlab.com/memuller.web/wp_site) PHP · 199 lines

1 <?php

2

3 class SQ_Frontend extends SQ_FrontController {

49 if (SQ_Tools::$options['sq_auto_sitemap'] == 1) {

50 foreach (SQ_Tools::$options['sq_sitemap'] as $name => $sitemap) {

51 $rules[preg_quote($sitemap[0]) . '$'] = 'index.php?sq_feed=' . $name;

52 }

53 }

56

57 private function _isAjax() {

58 if (isset($_SERVER['PHP_SELF']) && strpos($_SERVER['PHP_SELF'], '/admin-ajax.php') !== false)

59 return true;

60

101 $find = $replace = $urls = array();

102

103 @preg_match_all('/<img[^>]*src=[\'"]([^\'"]+)[\'"][^>]*>/i', $content, $out);

104 if (is_array($out)) {

105 if (!is_array($out[1]) || empty($out[1]))

List.php (https://github.com/psoetens/orocos-www.git) PHP · 250 lines

1 <?php

2

3 /**

10 *

11 * @author Justin Patrin <papercrane@reversefold.com>

12 * @author Paul M. Jones <pmjones@php.net>

13 *

14 * @license LGPL

15 *

16 * @version $Id: List.php,v 1.1 2005/07/21 20:56:14 justinpatrin Exp $

17 *

18 */

35 *

36 * @author Justin Patrin <papercrane@reversefold.com>

37 * @author Paul M. Jones <pmjones@php.net>

38 *

39 */

porteren.php (https://github.com/dextercowley/joomla-cms.git) PHP · 451 lines

1 <?php

2 /**

3 * @package Joomla.Platform

5 *

6 * @copyright Copyright (C) 2005 - 2014 Open Source Matters, Inc. All rights reserved.

7 * @copyright Copyright (C) 2005 Richard Heyes (http://www.phpguru.org/). All rights reserved.

8 * @license GNU General Public License version 2 or later; see LICENSE

9 */

405 $str = preg_replace("#$v+$#", '', $str);

406

407 preg_match_all("#($v+$c+)#", $str, $matches);

408

409 return count($matches[1]);

porteren.php (https://gitlab.com/lankerd/paGO---Testing-Site) PHP · 449 lines

1 <?php

2 /**

3 * @package Joomla.Platform

5 *

6 * @copyright Copyright (C) 2005 - 2016 Open Source Matters, Inc. All rights reserved.

7 * @copyright Copyright (C) 2005 Richard Heyes (http://www.phpguru.org/). All rights reserved.

8 * @license GNU General Public License version 2 or later; see LICENSE

9 */

403 $str = preg_replace("#$v+$#", '', $str);

404

405 preg_match_all("#($v+$c+)#", $str, $matches);

406

407 return count($matches[1]);

post_edition.php (https://bitbucket.org/pombredanne/spip-zone-treemap.git) PHP · 88 lines

1 <?php

2 /***************************************************************************

3 * Associaspip, extension de SPIP pour gestion d'associations *

33 /* on recupere dans la bio les champs fonction, telephone, mobile, adresse, code postal et ville: 1 par ligne (sauf code postal et ville) */

34 $bio = $auteur['bio'];

35 if (preg_match_all('/(.+)$/m', $bio, $r)

36 AND preg_match('/^\s*(\d{5})\s+(.*)/', $r[0][4], $m))

37 $modif = array(

OutputFormatter.php (https://gitlab.com/pthapa81/MeroSaaman-1.0) PHP · 241 lines

1 <?php

2

3 /*

146 $output = '';

147 $tagRegex = '[a-z][a-z0-9_=;-]*';

148 preg_match_all("#<(($tagRegex) | /($tagRegex)?)>#isx", $message, $matches, PREG_OFFSET_CAPTURE);

149 foreach ($matches[0] as $i => $match) {

150 $pos = $match[1];

204 }

205

206 if (!preg_match_all('/([^=]+)=([^;]+)(;|$)/', strtolower($string), $matches, PREG_SET_ORDER)) {

207 return false;

208 }

ValidVariableNameSniff.php (https://github.com/squizlabs/PHP_CodeSniffer.git) PHP · 196 lines

22 * Processes this test, when one of its tokens is encountered.

23 *

24 * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned.

25 * @param int $stackPtr The position of the current token in the

26 * stack passed in $tokens.

107 * Processes class member variables.

108 *

109 * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned.

110 * @param int $stackPtr The position of the current token in the

111 * stack passed in $tokens.

162 * Processes the variable found within a double quoted string.

163 *

164 * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned.

165 * @param int $stackPtr The position of the double quoted

166 * string.

sfThemeTokenParser.class.php (https://bitbucket.org/Boniboy/portal.git) PHP · 229 lines

24 public function renderPhpText($text)

25 {

26 return $this->replaceTokens($text, 'php');

27 }

28

94 case 'html':

95 if ($renderTextAsBlock) {

96 $string = $this->renderTextInPhpBlock($this->escapeString($string));

97 }

98 break;

100 case 'php':

101 $string = $this->asPhp($string);

102 break;

103 }

150 "(''." => '(', // start of function

151 ", ''." => ', ', // start array value

152 "<?php echo ''." => '<?php echo ', // start of php block

153 ".'')" => ')', // end of function

154 ".''," => ',', // end of array value

ExpressCheckout.php (https://github.com/br-paypaldev/paypal-refund.git) PHP · 203 lines

1 <?php

2 /**

3 * Pacote de integração com PayPal

93 $matches = array();

94

95 if ( preg_match_all(

96 '/(?<name>[^\=]+)\=(?<value>[^&]+)&?/',

97 $httpResponse->getContent(),

Font_Glyph_Outline_Simple.php (https://gitlab.com/techniconline/kmc) PHP · 331 lines

1 <?php

2 /**

3 * @package php-font-lib

4 * @link https://github.com/PhenX/php-font-lib

5 * @author Fabien Ménager <fabien.menager@gmail.com>

6 * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License

7 * @version $Id: Font_Table_glyf.php 46 2012-04-02 20:22:38Z fabien.menager $

8 */

9

11 * `glyf` font table.

12 *

13 * @package php-font-lib

14 */

15 class Font_Glyph_Outline_Simple extends Font_Glyph_Outline

Output.php (https://github.com/sebio/symfony.git) PHP · 231 lines

1 <?php

2

3 /*

192 } else {

193 // bg=blue;fg=red

194 if (!preg_match_all('/([^=]+)=([^;]+)(;|$)/', strtolower($match[1]), $matches, PREG_SET_ORDER)) {

195 throw new \InvalidArgumentException(sprintf('Unknown style "%s".', $match[1]));

196 }

aa_item.php (https://github.com/harz87/Amazon-Affialiate.git) PHP · 227 lines

1 <?php

2 /*

3 * To change this template, choose Tools | Templates

15 function output($item, $format, $target='html'){

16 $output = $format;

17 preg_match_all("/#@?_?[A-Za-z0-9]+/", $format, $placeholders);

18 foreach($placeholders[0] as $result){

19 $replace = '';

Conditions.php (https://gitlab.com/daigiangaitu91/magento) PHP · 259 lines

1 <?php

2 /**

3 * Copyright © 2015 Magento. All rights reserved.

245 private function parseCondition($condition)

246 {

247 if (!preg_match_all('/([^|]+\|?)/', $condition, $match)) {

248 throw new \Exception('Bad format condition');

249 }

class-lp-question-fill-in-blank.php (https://gitlab.com/gregtyka/lfmawordpress) PHP · 252 lines

1 <?php

2 if ( class_exists( 'LP_Abstract_Question' ) ) {

3 /**

181 $answered = !empty( $args['answered'] ) ? $args['answered'] : array();

182

183 $view = LP_Addon_Question_Fill_In_Blank::locate_template( 'fill-in-blank.php' );

184 include $view;

185

206

207 $passage = $this->passage;

208 if ( preg_match_all( $this->_shortcode_pattern, $passage, $matches ) ) {

209 settype( $args, 'array' );

210 $input_pos = array();

loadmodule.php (https://github.com/joomla/joomla-cms.git) PHP · 237 lines

1 <?php

2

3 /**

8 * @license GNU General Public License version 2 or later; see LICENSE.txt

9

10 * @phpcs:disable PSR1.Classes.ClassDeclaration.MissingNamespace

11 */

12

64 // Find all instances of plugin and put in $matches for loadposition

65 // $matches[0] is full pattern match, $matches[1] is the position

66 preg_match_all($regex, $article->text, $matches, PREG_SET_ORDER);

67

68 // No matches, skip this

91

92 // Find all instances of plugin and put in $matchesmod for loadmodule

93 preg_match_all($regexmod, $article->text, $matchesmod, PREG_SET_ORDER);

94

95 // If no matches, skip this

template.php (https://gitlab.com/srueegger/1zu12bB) PHP · 290 lines

1 <?php

2 class Template{

3 private $template = "";

32 */

33 private function initialize_loops($template){

34 preg_match_all("/{LOOP:([\w]+)[^}]*}((.|\s)*?){\/LOOP:(\s*?.*?)*}/", $template, $matches, PREG_SET_ORDER);

35

36 foreach ($matches as $match) {

197

198 private function replaceLanguageTokens(){

199 preg_match_all("/{LANG:(.+)}/", $this->template, $matches, PREG_SET_ORDER);

200 foreach($matches as $match){

201 $translation = htmlentities(Language::DirectTranslate($match[1]));

205

206 private function replaceIcons(){

207 preg_match_all("/{ICON:(.+)}/", $this->template, $matches, PREG_SET_ORDER);

208 foreach($matches as $match){

209 $translation = htmlentities(Icons::getIcon($match[1]));

customsql.php (https://gitlab.com/inglobe/mgt-clemente-css) PHP · 126 lines

1 <?php

2

3 class CustomSQLUtility extends Magmi_UtilityPlugin

25 $params = array();

26 $content = file_get_contents($file);

27 $hasp = preg_match_all('|\[\[(.*?)\]\]|msi', $content, $matches);

28 if ($hasp) {

29 $params = $matches[1];

47 {

48 $pparams = array();

49 $hasnps = preg_match_all('|\[\[(\w+?)/.*?\]\]|msi', $stmt, $matches);

50 if ($hasnps) {

51 $namedparams = $matches[1];

57 }

58

59 $hasp = preg_match_all('|\[\[(tn:.*?)\]\]|msi', $stmt, $matches);

60 if ($hasp) {

61 $pparams = $matches[1];

Mockup.php (https://github.com/sergiygladkyy/OEF.git) PHP · 283 lines

1 <?php

2

3 require_once('lib/report/Grid.php');

4 require_once('lib/report/Area.php');

5

6 class Mockup extends Grid

151 protected function addArea($names, array $coord)

152 {

153 if (!preg_match_all('/(?<=[\s]|\A)[A-Za-z_][A-Za-z_0-9]*(?=[\s]|\z)/i', $names, $matches))

154 {

155 return false;

196 protected function getParameters($content)

197 {

198 if (!preg_match_all('/(?<=\[)[A-Za-z_][A-Za-z_0-9]*?(?=\])/i', $content, $matches)) return array();

199

200 return $matches[0];

class-counters-box.php (https://gitlab.com/woxiprogrammers/infinia-wordpress) PHP · 262 lines

1 <?php

2 class FusionSC_CountersBox {

3

242 function set_num_of_columns( $content ) {

243 if( ! self::$parent_args['columns'] ) {

244 preg_match_all( '/(\[counter_box (.*?)\](.*?)\[\/counter_box\])/s', $content, $matches );

245 if( is_array( $matches ) &&

246 ! empty( $matches )

Blockquote.php (https://github.com/durand54/sitellite.git) PHP · 163 lines

1 <?php

2

3 /**

10 * quoting.

11 *

12 * $Id: Blockquote.php,v 1.1.1.1 2005/02/04 17:01:50 lux Exp $

13 *

14 * @author Paul M. Jones <pmjones@ciaweb.net>

69 // create an array called $list that contains a new set of

70 // matches for the various list-item elements.

71 preg_match_all(

72 '=^(\>+) (.*\n)=Ums',

73 $matches[1],

lib.php (https://gitlab.com/MotoSport/morgue) PHP · 132 lines

1 <?php

2

3 #require_once('Persistence.php');

70

71 foreach($terms_rx as $term_rx){

72 $row['score'] += preg_match_all("/$term_rx/i", $row['summary'], $null);

73 $row['score'] += preg_match_all("/$term_rx/i", $row['title'], $null);

languagecode.php (https://github.com/rvsjoen/joomla-cms.git) PHP · 141 lines

1 <?php

2 /**

3 * @package Joomla.Plugin

55

56 // Replace codes in <link hreflang="" /> attributes

57 preg_match_all(chr(1) . '(<link.*\s+hreflang=")([0-9a-z\-]*)(".*\s+rel="alternate".*/>)' . chr(1) . 'i', $body, $matches);

58 foreach ($matches[2] as $match)

59 {

65 }

66 }

67 preg_match_all(chr(1) . '(<link.*\s+rel="alternate".*\s+hreflang=")([0-9A-Za-z\-]*)(".*/>)' . chr(1) . 'i', $body, $matches);

68 foreach ($matches[2] as $match)

69 {

helper.php (https://github.com/amet17/webstar.git) PHP · 126 lines

1 <?php

2 defined('_JEXEC') or die('Direct Access to this location is not allowed.');

3

26 if( $file )

27 {

28 if( preg_match_all($regexp, $file, $match) )

29 {

30 foreach( $match[0] as $html )

driver.php (https://github.com/ot2sen/Tamka.git) PHP · 144 lines

1 <?php

2 /**

3 * @package Molajo

30 {

31 /** extract maps **/

32 preg_match_all( "#{googlemaps}(.*?){/googlemaps}#s", $content->$location, $matches );

33

34 if (count($matches) == 0) { return; }

stylesheet.php (https://gitlab.com/campus-academy/krowkaramel) PHP · 414 lines

1 <?php

2 namespace Elementor;

3

151

152 if ( null === $style_rules ) {

153 preg_match_all( '/([^\s].+?(?=\{))\{((?s:.)+?(?=}))}/', $selector, $parsed_rules );

154

155 foreach ( $parsed_rules[1] as $index => $selector ) {

lmbSingleByteStringsDriverTest.class.php (https://github.com/limb-php-framework/limb-app-buildman.git) PHP · 178 lines

1 <?php

2 /**

3 * Limb Web Application Framework

7 * @copyright Copyright &copy; 2004-2007 BIT

8 * @license LGPL http://www.gnu.org/copyleft/lesser.html

9 * @version $Id: lmbSingleByteStringsDriverTest.class.php 4998 2007-02-08 15:36:32Z pachanga $

10 * @package i18n

11 */

12 lmb_require('limb/i18n/src/charset/lmbSingleByteStringsDriver.class.php');

13

14 class lmbSingleByteStringsDriverTest extends UnitTestCase

122

123 function test_str_split() {

124 if(phpversion() < 5)

125 return;

126

an.php (https://gitlab.com/phamngsinh/baitaplon_sinhvien) PHP · 130 lines

1 <?php

2 if($_GET['xem']='')

3 {

20 $content= $_GET['id'];

21 //$content = "10832.aspx?LeagueID=-1";

22 preg_match_all('@(.*?).aspx?@',$content, $match,PREG_SET_ORDER);

23

24 $id= $match[0][1];

51 $content= $_GET['id'];

52 //$content = "10832.aspx?LeagueID=-1";

53 preg_match_all('@(.*?).aspx?@',$content, $match,PREG_SET_ORDER);

54

55 $id= $match[0][1];

85 $content= $_GET['id2'];

86 //$content = "10832.aspx?LeagueID=-1";

87 preg_match_all('@(.*?).aspx?@',$content, $match,PREG_SET_ORDER);

88

89 $id2= $match[0][1];

I18nBehaviorObjectBuilderModifier.php (https://github.com/vworldat/Propel2.git) PHP · 212 lines

162 'comment' => $comment,

163 'functionStatement' => $functionStatement,

164 'columnPhpName' => $column->getPhpName(),

165 'params' => implode(', ', $params[0]),

166 ));

184 }

185 $comment = preg_replace('/^\t/m', '', $comment);

186 $comment = str_replace('@return ' . $i18nTablePhpName, '@return ' . $tablePhpName, $comment);

187 $functionStatement = preg_replace('/^\t/m', '', $functionStatement);

188 preg_match_all('/\$[a-z]+/i', $functionStatement, $params);

190 'comment' => $comment,

191 'functionStatement' => $functionStatement,

192 'columnPhpName' => $column->getPhpName(),

193 'params' => implode(', ', $params[0]),

194 ));

DefinedNames.php (https://github.com/sbourget/moodle.git) PHP · 242 lines

1 <?php

2

3 namespace PhpOffice\PhpSpreadsheet\Writer\Xlsx;

4

5 use Exception;

6 use PhpOffice\PhpSpreadsheet\Calculation\Calculation;

7 use PhpOffice\PhpSpreadsheet\Cell\Coordinate;

8 use PhpOffice\PhpSpreadsheet\DefinedName;

9 use PhpOffice\PhpSpreadsheet\Shared\XMLWriter;

10 use PhpOffice\PhpSpreadsheet\Spreadsheet;

11 use PhpOffice\PhpSpreadsheet\Worksheet\Worksheet;

utils-forms.inc.php (https://gitlab.com/Gashler/dp) PHP · 98 lines

1 <?php

2 /**

3 * Form utilities.

75 if (preg_match ("/\<form(.+?)\>/is", $form)) // Is this a form?

76 {

77 if (preg_match_all ("/(?<!\<\!--)\<input(.+?)\>/is", $form, $input_attr_ms, PREG_SET_ORDER))

78 {

79 foreach ($input_attr_ms as $input_attr_m) // Go through each hidden input variable.

porteren.php (https://github.com/elinw/joomla-cms.git) PHP · 451 lines

1 <?php

2 /**

3 * @package Joomla.Platform

5 *

6 * @copyright Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.

7 * @copyright Copyright (C) 2005 Richard Heyes (http://www.phpguru.org/). All rights reserved.

8 * @license GNU General Public License version 2 or later; see LICENSE

9 */

405 $str = preg_replace("#$v+$#", '', $str);

406

407 preg_match_all("#($v+$c+)#", $str, $matches);

408

409 return count($matches[1]);

getPages.php (https://gitlab.com/morganestes/wordpress-develop) PHP · 696 lines

1 <?php

2

3 /**

368 self::factory()->post->create_many( 5, array( 'post_type' => 'page' ) );

369

370 preg_match_all( '#<option#', wp_dropdown_pages( 'echo=0' ), $matches );

371

372 $this->assertEquals( 5, count( $matches[0] ) );

Announce.php (https://github.com/cadorn/firephp-dotcloud.git) PHP · 123 lines

1 <?php

2

3 require_once 'Wildfire/Protocol.php';

4 require_once 'Wildfire/Message.php';

5

6 class Wildfire_Protocol_Announce extends Wildfire_Protocol

18

19 // 62|...|\

20 if(!preg_match_all('/^(\d*)?\|(.*)\|(\\\)?$/si' ,$value, $m)) {

21 throw new Exception("Error parsing message: " . $value);

22 }

104 $message->setReceiver($receiver);

105

106 preg_match_all('/^(.*?[^\\\])?\|(.*)$/si', $value, $m);

107

108 $message->setMeta($m[1][0] || null);

form-tags-manager.php (https://github.com/livinglab/openlab.git) PHP · 380 lines

1 <?php

2

3 function wpcf7_add_form_tag( $tag, $func, $features = '' ) {

369

370 if ( ! empty( $match[2] ) ) {

371 preg_match_all( '/"[^"]*"|\'[^\']*\'/', $match[2], $matched_values );

372 $atts['values'] = wpcf7_strip_quote_deep( $matched_values[0] );

373 }

CheckboxTest.php (https://github.com/leerbag/zf2.git) PHP · 218 lines

1 <?php

2 /**

3 * Zend Framework

26 Zend\Form\Element,

27 Zend\Form\Decorator,

28 Zend\View\PhpRenderer as View;

29

30 /**

38 * @group Zend_Form

39 */

40 class CheckboxTest extends \PHPUnit_Framework_TestCase

41 {

42 /**

204 $this->element->setValue($this->element->getUncheckedValue());

205 $html = $this->element->render($this->getView());

206 if (!preg_match_all('/(<input[^>]+>)/', $html, $matches)) {

207 $this->fail('Unexpected generated HTML: ' . $html);

208 }