Skip to content

Commit f05609d

Browse files
updates to draft.md moved over from README.
1 parent 34dcf90 commit f05609d

File tree

2 files changed

+21
-22
lines changed

2 files changed

+21
-22
lines changed

README.md

+4-7
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,10 @@ SO THAT I can understand the search pattern the regex defines
1010

1111
how to create a gist and its URL.
1212

13-
Instead of creating a repository, you’ll publish a GitHub gist. GitHub describes a gist as a simple way to share code snippets with others. It’s also an ideal way to demonstrate a technique, teach a principle, or show off a solution. It functions just like a repository, and you’ll use Markdown to create it, just as you do with your READMEs. Gists can include code, images, links, and anything else you can include in a README.
13+
Instead of creating a repository, you’ll publish a GitHub gist. GitHub describes a gist as a simple way to share code snippets with others. It’s also an ideal way to demonstrate a technique, teach a principle, or show off a solution. It functions just like a repository, and you’ll use Markdown to create it, just as you do with your READMEs. Gists can include code, images, links, and anything else you can include in a README.
1414

15-
After you’ve cloned the starter code, learn how to create a gistLinks to an external site.. You can also watch this video on how to use gistsLinks to an external site..
15+
* After you’ve cloned the starter code, learn how to create a gist
16+
* You can also watch this video on how to use gists
1617

1718
## What Is a Regex?
1819
* A regex, which is short for regular expression, is a sequence of characters that defines a specific search pattern. When included in code or search algorithms, regular expressions can be used to find certain patterns of characters within a string, or to find and replace a character or sequence of characters within a string. They are also frequently used to validate input.
@@ -23,13 +24,9 @@ After you’ve cloned the starter code, learn how to create a gistLinks to an ex
2324

2425
* Each component of this regex has a unique responsibility to make sure that a user enters an email address that begins with an unspecified number of characters preceding the @ symbol, followed by a domain.
2526

26-
* Before you get started, watch this introduction to regular expressions videoLinks to an external site. and read Regex Tutorial: Matching a UsernameLinks to an external site. to learn how to identify the different components that make up a regex.
27-
28-
* If you need any additional help, there are many resources on the web. Feel free to do your own research to find one that can help you complete this assignment.
27+
* Before you get started, watch this introduction to regular expressions video and read Regex Tutorial: Matching a Username to learn how to identify the different components that make up a regex.
2928

3029
Once you have a better understanding of what these different parts of a regular expression do, you’ll need to explain what they do for a specific regex.
31-
32-
https://www.youtube.com/watch?v=9RksQ5YT7FM
3330

3431
Matching a Hex Value
3532
/^#?([a-f0-9]{6}|[a-f0-9]{3})$/

draft.md

+17-15
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Matching a Hex Value: A Regex Tutorial
22

3-
EXAMPLE DRAFT : This gist tutorial explains how to match a hex value, search and replace a hex value, and verify a hex value.
3+
EXAMPLE DRAFT : This gist tutorial explains how to match a hex value as it relates to JavaScript.
44

55
## Introductory Paragraph
66

@@ -15,25 +15,27 @@ A regular expression (regex) is a jumble of characters that web developers use t
1515

1616
## Table of Contents
1717

18-
* [Tutorials](#tutorials)
18+
* [Tutorial](#tutorial)
1919
* [Hex Value Matching](#hex-value-matching)
20-
* [Search and Replace a Hex Value](#search-and-replace-a-hex-value)
21-
* [Verifying the Hex Value](#verifying-the-hex-value)
2220
* [About the Author](#about-the-author)
2321

24-
## Tutorials
22+
## Tutorial
2523

24+
###
2625
* WHEN I read through each section of the tutorial, THEN I find a detailed explanation of what a specific component of the regex does
27-
* * EACH section breaks down EACH COMPONENT of the regex AND EXPLAINS what it does for the hex value.
28-
29-
### Hex Value Matching
30-
31-
Let's define a search pattern using regex to search for a hex value.
32-
33-
* Who what when where why how
34-
1. one
35-
2. two
36-
3. three
26+
* EACH section breaks down EACH COMPONENT of the regex AND EXPLAINS what it does for the hex value.
27+
28+
The forward slashes / denote the beginning and the end of a regex expression and will define a search pattern within JavaScript. Let's focus on the values between the forward slashes.
29+
^ symbol. For this hex value, the carat ^ indicates the start of the string or line.
30+
31+
# symbol. The # sign is a token that matches a # character. (character code 35)
32+
? symbol. This question mark (?) matches a number between 0 and 1 of the preceding token, which is #.
33+
() The parentheses groups multiple expressions together so as to extract a substring or use a back reference.
34+
[] Within the parentheses, there are square brackets. The square brackets contain a range of numbers (a-f) and/or case-sensitive letters (0-9). The brackets will match any single character in this range.
35+
- The hyphen represents a range of letters or numbers in a square bracket.
36+
{} The curly braces (in this particular case with the hex value) contain one number. This digit {n} indicates that that value inside the brackets [] occurs or matches exactly n times.
37+
| The pipe symbol stands for alternation. It behaves like a boolean (values of true or false). It matches the expression before or after the | symbol.
38+
$ The dollar sign means "end." It matches the end of the string, in this case.
3739

3840
### Search and Replace a Hex Value
3941

0 commit comments

Comments
 (0)