/pattern/options <ul><li>Regex syntax </li></ul>
[abc] <ul><li>A single character: a, b, or c </li></ul>
[^abc] <ul><li>Any single character but a, b, or c </li></ul>
[a-z] <ul><li>Any single character in the range a-z </li></ul>
[a-zA-Z] <ul><li>Any single character in the range a-z or A-Z </li></ul>
^ <ul><li>Start of line </li></ul>
$ <ul><li>End of line </li></ul>
A <ul><li>Start of string </li></ul>
z <ul><li>End of string </li></ul>
. <ul><li>Any single character </li></ul>
s <ul><li>Any whitespace character </li></ul>
S <ul><li>Any non-whitespace character </li></ul>
d <ul><li>Any digit </li></ul>
D <ul><li>Any non-digit </li></ul>
w <ul><li>Any word character (letter, number, underscore) </li></ul>
W <ul><li>Any non-word character </li></ul>
 <ul><li>Any word boundary character </li></ul>
(...) <ul><li>Capture everything enclosed </li></ul>
(a|b) <ul><li>a or b </li></ul>
a? <ul><li>Zero or one of a </li></ul>
a* <ul><li>Zero or more of a </li></ul>
a+ <ul><li>One or more of a </li></ul>
a{3} <ul><li>Exactly 3 of a </li></ul>
a{3,} <ul><li>3 or more of a </li></ul>
a{3,6} <ul><li>Between 3 and 6 of a </li></ul>
i <ul><li>Case insensitive option. </li></ul>
i <ul><li>Case insensitive option. </li></ul>
m <ul><li>make dot match newlines </li></ul>
x <ul><li>ignore whitespace in regex </li></ul>
www.rubular.com <ul><li>Credit for content and a great tool for practicing. </li></ul>
Upcoming SlideShare
Loading in …5
×

Regex Cards - Powerpoint Format

1,392 views
1,313 views

Published on

Deck for studying up on regular expressions.

This was purposefully kept free of any styling etc as this is the actual deck I use for memorization and don't like distractions.

Published in: Technology, Business
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
1,392
On SlideShare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
42
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Regex Cards - Powerpoint Format

  1. 2. /pattern/options <ul><li>Regex syntax </li></ul>
  2. 3. [abc] <ul><li>A single character: a, b, or c </li></ul>
  3. 4. [^abc] <ul><li>Any single character but a, b, or c </li></ul>
  4. 5. [a-z] <ul><li>Any single character in the range a-z </li></ul>
  5. 6. [a-zA-Z] <ul><li>Any single character in the range a-z or A-Z </li></ul>
  6. 7. ^ <ul><li>Start of line </li></ul>
  7. 8. $ <ul><li>End of line </li></ul>
  8. 9. A <ul><li>Start of string </li></ul>
  9. 10. z <ul><li>End of string </li></ul>
  10. 11. . <ul><li>Any single character </li></ul>
  11. 12. s <ul><li>Any whitespace character </li></ul>
  12. 13. S <ul><li>Any non-whitespace character </li></ul>
  13. 14. d <ul><li>Any digit </li></ul>
  14. 15. D <ul><li>Any non-digit </li></ul>
  15. 16. w <ul><li>Any word character (letter, number, underscore) </li></ul>
  16. 17. W <ul><li>Any non-word character </li></ul>
  17. 18.  <ul><li>Any word boundary character </li></ul>
  18. 19. (...) <ul><li>Capture everything enclosed </li></ul>
  19. 20. (a|b) <ul><li>a or b </li></ul>
  20. 21. a? <ul><li>Zero or one of a </li></ul>
  21. 22. a* <ul><li>Zero or more of a </li></ul>
  22. 23. a+ <ul><li>One or more of a </li></ul>
  23. 24. a{3} <ul><li>Exactly 3 of a </li></ul>
  24. 25. a{3,} <ul><li>3 or more of a </li></ul>
  25. 26. a{3,6} <ul><li>Between 3 and 6 of a </li></ul>
  26. 27. i <ul><li>Case insensitive option. </li></ul>
  27. 28. i <ul><li>Case insensitive option. </li></ul>
  28. 29. m <ul><li>make dot match newlines </li></ul>
  29. 30. x <ul><li>ignore whitespace in regex </li></ul>
  30. 31. www.rubular.com <ul><li>Credit for content and a great tool for practicing. </li></ul>

×