User Tools

Site Tools


Sidebar

Software

preg_match

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)