REGULAR EXPRESSIONS

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/29

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 12:11 PM on 6/15/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No analytics yet

Send a link to your students to track their progress

30 Terms

1
New cards

Regular Expressions

______ are patterns that are used for matching and manipulating strings according to specified rules

2
New cards
  • POSIX Extended

  • Perl Compatible Regular Expressions

PHP supports two types of regular expressions:

3
New cards

preg_match()

Pass to the _____ the regular expression pattern as the first argument and a string containing the text you want to search as the second argument

4
New cards

regular expression pattern

A ______ is a special text string that describes a search pattern

5
New cards

metacharacters

Regular expression patterns consist of literal characters and ______, which are special characters that define the pattern- matching rules

6
New cards

forward slash (/)

Regular expression patterns are enclosed in opening and closing delimiters. The most common character delimiter is the _____

7
New cards

period (.)

A ______ in a regular expression pattern specifies that the pattern must contain a value at the location of the _____

8
New cards

0, 1

A return value of __ indicates that the string does not match the pattern and __ if it does

9
New cards

anchor

An ____ specifies that the pattern must appear at a particular position in a string

10
New cards

^, $

The ___ metacharacter anchors characters to the beginning of a string. The ___ metacharacter anchors characters to the end of a string

11
New cards

backslash

To match any metacharacters as literal values in a regular expression, escape the character with a _____

12
New cards

quantifiers

Metacharacters that specify the quantity of a match are called _____

13
New cards

question mark (?)

A ______ quantifier specifies that the preceding character in the pattern is optional

14
New cards

addition(+)

The _____ quantifier specifies that one or more sequential occurrences of the preceding characters match

15
New cards

asterisk (*)

A ______ quantifier specifies that zero or more sequential occurrences of the preceding characters match

16
New cards

{ }

The____ quantifiers specify the number of times that a character must repeat sequentially

17
New cards

subexpression, subpattern

When a set of characters enclosed in parentheses are treated as a group, they are referred to as a _____ or ______

18
New cards

Character classes

_____ in regular expressions treat multiple characters as a single item

19
New cards

([])

Characters enclosed with the____ metacharacters represent alternate characters that are allowed in a pattern match

20
New cards

hyphen metacharacter (-)

The ______ specifies a range of values in a character class

21
New cards

^

The __ metacharacter (placed immediately after the opening bracket of a character class) specifies optional characters to exclude in a pattern match

22
New cards

|

The __ metacharacter is used to specify an alternate set of patterns

23
New cards

OR

The | metacharacter is essentially the same as using the ___ operator to perform multiple evaluations in a conditional expression

24
New cards

Pattern modifiers

_____ are letters placed after the closing delimiter that change the default rules for interpreting matches

25
New cards
  • i

  • m

  • s

  • o

  • The pattern modifier, __, indicates that the case of the letter does not matter when searching

  • The pattern modifier, __, allows searches across newline characters

  • The pattern modifier, __, changes how the . (period) metacharacter works

  • The pattern modifier, __, evaluates the expression only once

26
New cards

Character classes

_____ specify an entire range of characters, for example, the alphabet or an integer set

27
New cards

[[:alpha:]]

It matches any string containing alphabetic characters aA through zZ.

28
New cards

[[:digit:]]

It matches any string containing numerical digits 0 through 9.

29
New cards

[[:alnum:]]

It matches any string containing alphanumeric characters aA through zZ and 0 through 9

30
New cards

[[:space:]]

It matches any string containing a space.