Home  >  Article  >  Backend Development  >  PHP regular expression complete tutorial five

PHP regular expression complete tutorial five

WBOY
WBOYOriginal
2016-07-25 08:52:021045browse
PHP regular expression complete tutorial 5, some examples of PHP regular expression

Some examples of php regular expressions Regular Expression Description /b([a-z]+) 1b/gi The position where a word appears continuously /(w+)://([^/:]+)(:d*)?([^# ]*)/ Parses a URL into protocol, domain, port and relative path /^(?:Chapter|Section) [1-9][0-9]{0,1}$/ Locate the position of the chapter /[-a-z]/ A to z, a total of 26 letters plus a - sign. /terb/ can match chapter, but not terminal /Bapt/ can match chapter, but not aptitude /Windows(?=95 |98 |NT )/ can match Windows95 or Windows98 or WindowsNT. When a match is found, start the next one from behind Windows



Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn