User Tools

Site Tools


preg_match

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

preg_match [2019/12/17 12:13] (current)
Line 1: Line 1:
 +====== preg_match ======
 +----
 +preg_match - Perform a regular expression match
  
 +
 +===== Description =====
 +  preg_match("​$pattern","​$subject"​)
 +  preg_match("​$pattern","​$subject",​$group)
 +  ​
 +This function returns a string
 +
 +
 +===== Parameters =====
 +** $pattern **\\
 +The pattern to search for, as a string
 +
 +** $subject **\\
 +The input string
 +
 +** $group **\\
 +The regex group number to send the match
 +
 +===== Examples =====
 +  $regex1=preg_match("​\w*","​hello world"​)
 +  $regex2=preg_match("​hello\s(.*)","​hello world",​1)
 +  alert($regex1)
 +  alert($regex2)
preg_match.txt ยท Last modified: 2019/12/17 12:13 (external edit)