PageRenderTime 44ms CodeModel.GetById 19ms RepoModel.GetById 0ms app.codeStats 0ms

/plugins/com.aptana.editor.php.epl/Resources/language/php5.3/pcre.php

https://github.com/haegyung/aptana-php
PHP | 371 lines | 25 code | 12 blank | 334 comment | 0 complexity | 0ea27a3c2cbac56d7fb657d317f5223c MD5 | raw file
  1. <?php
  2. // Start of pcre v.
  3. /**
  4. * Perform a regular expression match
  5. * @link http://www.php.net/manual/en/function.preg-match.php
  6. * @param pattern string <p>
  7. * The pattern to search for, as a string.
  8. * </p>
  9. * @param subject string <p>
  10. * The input string.
  11. * </p>
  12. * @param matches array[optional] <p>
  13. * If matches is provided, then it is filled with
  14. * the results of search. $matches[0] will contain the
  15. * text that matched the full pattern, $matches[1]
  16. * will have the text that matched the first captured parenthesized
  17. * subpattern, and so on.
  18. * </p>
  19. * @param flags int[optional] <p>
  20. * flags can be the following flag:
  21. * PREG_OFFSET_CAPTURE
  22. * If this flag is passed, for every occurring match the appendant string
  23. * offset will also be returned. Note that this changes the value of
  24. * matches into an array where every element is an
  25. * array consisting of the matched string at offset 0
  26. * and its string offset into subject at offset
  27. * 1.
  28. * @param offset int[optional] <p>
  29. * Normally, the search starts from the beginning of the subject string.
  30. * The optional parameter offset can be used to
  31. * specify the alternate place from which to start the search (in bytes).
  32. * </p>
  33. * <p>
  34. * Using offset is not equivalent to passing
  35. * substr($subject, $offset) to
  36. * preg_match in place of the subject string,
  37. * because pattern can contain assertions such as
  38. * ^, $ or
  39. * (?&lt;=x). Compare:
  40. * ]]>
  41. * &example.outputs;
  42. * <p>
  43. * while this example
  44. * </p>
  45. * ]]>
  46. * <p>
  47. * will produce
  48. * </p>
  49. * Array
  50. * (
  51. * [0] => def
  52. * [1] => 0
  53. * )
  54. * )
  55. * ]]>
  56. * </p>
  57. * @return int preg_match returns the number of times
  58. * pattern matches. That will be either 0 times
  59. * (no match) or 1 time because preg_match will stop
  60. * searching after the first match. preg_match_all
  61. * on the contrary will continue until it reaches the end of
  62. * subject.
  63. * preg_match returns false if an error occurred.
  64. */
  65. function preg_match ($pattern, $subject, array &$matches = null, $flags = null, $offset = null) {}
  66. /**
  67. * Perform a global regular expression match
  68. * @link http://www.php.net/manual/en/function.preg-match-all.php
  69. * @param pattern string <p>
  70. * The pattern to search for, as a string.
  71. * </p>
  72. * @param subject string <p>
  73. * The input string.
  74. * </p>
  75. * @param matches array <p>
  76. * Normally, the search starts from the beginning of the subject string.
  77. * The optional parameter offset can be used to
  78. * specify the alternate place from which to start the search (in bytes).
  79. * </p>
  80. * <p>
  81. * Using offset is not equivalent to passing
  82. * substr($subject, $offset) to
  83. * preg_match_all in place of the subject string,
  84. * because pattern can contain assertions such as
  85. * ^, $ or
  86. * (?&lt;=x). See preg_match
  87. * for examples.
  88. * </p>
  89. * @param flags int[optional] <p>
  90. * Can be a combination of the following flags (note that it doesn't make
  91. * sense to use PREG_PATTERN_ORDER together with
  92. * PREG_SET_ORDER):
  93. * PREG_PATTERN_ORDER
  94. * <p>
  95. * Orders results so that $matches[0] is an array of full
  96. * pattern matches, $matches[1] is an array of strings matched by
  97. * the first parenthesized subpattern, and so on.
  98. * </p>
  99. * <p>
  100. * ]]>
  101. * &example.outputs;
  102. * example: , this is a test
  103. * example: , this is a test
  104. * ]]>
  105. * <p>
  106. * So, $out[0] contains array of strings that matched full pattern,
  107. * and $out[1] contains array of strings enclosed by tags.
  108. * </p>
  109. * </p>
  110. * @param offset int[optional]
  111. * @return int the number of full pattern matches (which might be zero),
  112. * or false if an error occurred.
  113. */
  114. function preg_match_all ($pattern, $subject, array &$matches, $flags = null, $offset = null) {}
  115. /**
  116. * Perform a regular expression search and replace
  117. * @link http://www.php.net/manual/en/function.preg-replace.php
  118. * @param pattern mixed <p>
  119. * The pattern to search for. It can be either a string or an array with
  120. * strings.
  121. * </p>
  122. * <p>
  123. * The e modifier makes preg_replace
  124. * treat the replacement parameter as PHP code after
  125. * the appropriate references substitution is done. Tip: make sure that
  126. * replacement constitutes a valid PHP code string,
  127. * otherwise PHP will complain about a parse error at the line containing
  128. * preg_replace.
  129. * </p>
  130. * @param replacement mixed <p>
  131. * The string or an array with strings to replace. If this parameter is a
  132. * string and the pattern parameter is an array,
  133. * all patterns will be replaced by that string. If both
  134. * pattern and replacement
  135. * parameters are arrays, each pattern will be
  136. * replaced by the replacement counterpart. If
  137. * there are fewer elements in the replacement
  138. * array than in the pattern array, any extra
  139. * patterns will be replaced by an empty string.
  140. * </p>
  141. * <p>
  142. * replacement may contain references of the form
  143. * \\n or (since PHP 4.0.4)
  144. * $n, with the latter form
  145. * being the preferred one. Every such reference will be replaced by the text
  146. * captured by the n'th parenthesized pattern.
  147. * n can be from 0 to 99, and
  148. * \\0 or $0 refers to the text matched
  149. * by the whole pattern. Opening parentheses are counted from left to right
  150. * (starting from 1) to obtain the number of the capturing subpattern.
  151. * To use backslash in replacement, it must be doubled
  152. * ("\\\\" PHP string).
  153. * </p>
  154. * <p>
  155. * When working with a replacement pattern where a backreference is
  156. * immediately followed by another number (i.e.: placing a literal number
  157. * immediately after a matched pattern), you cannot use the familiar
  158. * \\1 notation for your backreference.
  159. * \\11, for example, would confuse
  160. * preg_replace since it does not know whether you
  161. * want the \\1 backreference followed by a literal
  162. * 1, or the \\11 backreference
  163. * followed by nothing. In this case the solution is to use
  164. * \${1}1. This creates an isolated
  165. * $1 backreference, leaving the 1
  166. * as a literal.
  167. * </p>
  168. * <p>
  169. * When using the e modifier, this function escapes
  170. * some characters (namely ', ",
  171. * \ and NULL) in the strings that replace the
  172. * backreferences. This is done to ensure that no syntax errors arise
  173. * from backreference usage with either single or double quotes (e.g.
  174. * 'strlen(\'$1\')+strlen("$2")'). Make sure you are
  175. * aware of PHP's string
  176. * syntax to know exactly how the interpreted string will look
  177. * like.
  178. * </p>
  179. * @param subject mixed <p>
  180. * The string or an array with strings to search and replace.
  181. * </p>
  182. * <p>
  183. * If subject is an array, then the search and
  184. * replace is performed on every entry of subject,
  185. * and the return value is an array as well.
  186. * </p>
  187. * @param limit int[optional] <p>
  188. * The maximum possible replacements for each pattern in each
  189. * subject string. Defaults to
  190. * -1 (no limit).
  191. * </p>
  192. * @param count int[optional] <p>
  193. * If specified, this variable will be filled with the number of
  194. * replacements done.
  195. * </p>
  196. * @return mixed preg_replace returns an array if the
  197. * subject parameter is an array, or a string
  198. * otherwise.
  199. * </p>
  200. * <p>
  201. * If matches are found, the new subject will
  202. * be returned, otherwise subject will be
  203. * returned unchanged or &null; if an error occurred.
  204. */
  205. function preg_replace ($pattern, $replacement, $subject, $limit = null, &$count = null) {}
  206. /**
  207. * Perform a regular expression search and replace using a callback
  208. * @link http://www.php.net/manual/en/function.preg-replace-callback.php
  209. * @param pattern mixed <p>
  210. * The pattern to search for. It can be either a string or an array with
  211. * strings.
  212. * </p>
  213. * @param callback callback <p>
  214. * A callback that will be called and passed an array of matched elements
  215. * in the subject string. The callback should
  216. * return the replacement string.
  217. * </p>
  218. * <p>
  219. * You'll often need the callback function
  220. * for a preg_replace_callback in just one place.
  221. * In this case you can use an
  222. * anonymous function (since
  223. * PHP 5.3.0) or create_function to
  224. * declare an anonymous function as callback within the call to
  225. * preg_replace_callback. By doing it this way
  226. * you have all information for the call in one place and do not
  227. * clutter the function namespace with a callback function's name
  228. * not used anywhere else.
  229. * </p>
  230. * <p>
  231. * preg_replace_callback and
  232. * create_function
  233. * ]]>
  234. * </p>
  235. * @param subject mixed <p>
  236. * The string or an array with strings to search and replace.
  237. * </p>
  238. * @param limit int[optional] <p>
  239. * The maximum possible replacements for each pattern in each
  240. * subject string. Defaults to
  241. * -1 (no limit).
  242. * </p>
  243. * @param count int[optional] <p>
  244. * If specified, this variable will be filled with the number of
  245. * replacements done.
  246. * </p>
  247. * @return mixed preg_replace_callback returns an array if the
  248. * subject parameter is an array, or a string
  249. * otherwise. On errors the return value is &null;
  250. * </p>
  251. * <p>
  252. * If matches are found, the new subject will be returned, otherwise
  253. * subject will be returned unchanged.
  254. */
  255. function preg_replace_callback ($pattern, $callback, $subject, $limit = null, &$count = null) {}
  256. /**
  257. * Perform a regular expression search and replace
  258. * @link http://www.php.net/manual/en/function.preg-filter.php
  259. * @param pattern mixed
  260. * @param replacement mixed
  261. * @param subject mixed
  262. * @param limit int[optional]
  263. * @param count int[optional]
  264. * @return mixed an array if the subject
  265. * parameter is an array, or a string otherwise.
  266. * </p>
  267. * <p>
  268. * If matches are found, the new subject will
  269. * be returned, otherwise subject will be
  270. * returned unchanged or &null; if an error occurred.
  271. */
  272. function preg_filter ($pattern, $replacement, $subject, $limit = null, &$count = null) {}
  273. /**
  274. * Split string by a regular expression
  275. * @link http://www.php.net/manual/en/function.preg-split.php
  276. * @param pattern string <p>
  277. * The pattern to search for, as a string.
  278. * </p>
  279. * @param subject string <p>
  280. * The input string.
  281. * </p>
  282. * @param limit int[optional] <p>
  283. * If specified, then only substrings up to limit
  284. * are returned with the rest of the string being placed in the last
  285. * substring. A limit of -1, 0 or null means "no limit"
  286. * and, as is standard across PHP, you can use null to skip to the
  287. * flags parameter.
  288. * </p>
  289. * @param flags int[optional] <p>
  290. * flags can be any combination of the following
  291. * flags (combined with the | bitwise operator):
  292. * PREG_SPLIT_NO_EMPTY
  293. * If this flag is set, only non-empty pieces will be returned by
  294. * preg_split.
  295. * @return array an array containing substrings of subject
  296. * split along boundaries matched by pattern.
  297. */
  298. function preg_split ($pattern, $subject, $limit = null, $flags = null) {}
  299. /**
  300. * Quote regular expression characters
  301. * @link http://www.php.net/manual/en/function.preg-quote.php
  302. * @param str string <p>
  303. * The input string.
  304. * </p>
  305. * @param delimiter string[optional] <p>
  306. * If the optional delimiter is specified, it
  307. * will also be escaped. This is useful for escaping the delimiter
  308. * that is required by the PCRE functions. The / is the most commonly
  309. * used delimiter.
  310. * </p>
  311. * @return string the quoted string.
  312. */
  313. function preg_quote ($str, $delimiter = null) {}
  314. /**
  315. * Return array entries that match the pattern
  316. * @link http://www.php.net/manual/en/function.preg-grep.php
  317. * @param pattern string <p>
  318. * The pattern to search for, as a string.
  319. * </p>
  320. * @param input array <p>
  321. * The input array.
  322. * </p>
  323. * @param flags int[optional] <p>
  324. * If set to PREG_GREP_INVERT, this function returns
  325. * the elements of the input array that do not match
  326. * the given pattern.
  327. * </p>
  328. * @return array an array indexed using the keys from the
  329. * input array.
  330. */
  331. function preg_grep ($pattern, array $input, $flags = null) {}
  332. /**
  333. * Returns the error code of the last PCRE regex execution
  334. * @link http://www.php.net/manual/en/function.preg-last-error.php
  335. * @return int one of the following constants (explained on their own page):
  336. * PREG_NO_ERROR
  337. * PREG_INTERNAL_ERROR
  338. * PREG_BACKTRACK_LIMIT_ERROR (see also pcre.backtrack_limit)
  339. * PREG_RECURSION_LIMIT_ERROR (see also pcre.recursion_limit)
  340. * PREG_BAD_UTF8_ERROR
  341. * PREG_BAD_UTF8_OFFSET_ERROR (since PHP 5.3.0)
  342. */
  343. function preg_last_error () {}
  344. define ('PREG_PATTERN_ORDER', 1);
  345. define ('PREG_SET_ORDER', 2);
  346. define ('PREG_OFFSET_CAPTURE', 256);
  347. define ('PREG_SPLIT_NO_EMPTY', 1);
  348. define ('PREG_SPLIT_DELIM_CAPTURE', 2);
  349. define ('PREG_SPLIT_OFFSET_CAPTURE', 4);
  350. define ('PREG_GREP_INVERT', 1);
  351. define ('PREG_NO_ERROR', 0);
  352. define ('PREG_INTERNAL_ERROR', 1);
  353. define ('PREG_BACKTRACK_LIMIT_ERROR', 2);
  354. define ('PREG_RECURSION_LIMIT_ERROR', 3);
  355. define ('PREG_BAD_UTF8_ERROR', 4);
  356. define ('PREG_BAD_UTF8_OFFSET_ERROR', 5);
  357. define ('PCRE_VERSION', "7.9 2009-04-11");
  358. // End of pcre v.
  359. ?>