Home
Flashcards
Preview
Regular Expressions
Home
Get App
Take Quiz
Create
What is the secret behind ^ and $ which makes understanding expressions easier?
^ represents "starts with" so it's ALWAYs First
^Dal Never d^al or dal^
$ represents "ends with" so it's Always last
Dal# never #Dal or D#al
So if you search ^Dal# the result can only be Dal since it starts with and ends with "Dal"
'*', '+', and '?', What do these symbols mean?
"zero or more", "one or more", and "zero or one."
What is the difference between ^ and [^] as in ^me or [^me]
^me means that it must start with "me" but [^me] means that it can't contain "me"
What do regular expresssions need to be enclosed by, including variables
"/ /"
What PHP function checks for matches?
preg_match()
Added to look for something at the end of a string
$ as in bob$ matches dumbbob but not bobdumb
Added to look for something at the start of a string
^ as in ^cat matches catalog but not concatenate
Wildcard
. period
Wildcard for zero or more
*
Look for either a A or B make sure you have the symbol for or
(A|B)
Requires that there be one or more of the characters it follows
+ as in (a|B) must have an a or B
Search for something in a range
[a-z]
Set the range of a number of occurences. As in give me 2-5 A's
{2,5} as in A{2,5} is looking for
AA
AAA
AAAA
AAAAA
Exclude characters....
[^] as in [^A] means no A can be in the search
When you use exclusion brackets what is special about them?
Everything except - ][ and ^ are taken literally. thus
you get a mishmash, since you can't use separaters
a-zA-Z0-9
Wildcard for 0 or 1
?
Escape character so you can use a . or a ^ or a $
\
Author
dalbabes
ID
107003
Card Set
Regular Expressions
Description
Regular expression help
Updated
2012-07-26T15:48:37Z
Show Answers
Home
Flashcards
Preview