Skip to content

Commit 9c8ae81

Browse files
Minor fixes for regex
These problems were found as I transferred them to LFD121. Signed-off-by: David A. Wheeler <[email protected]>
1 parent 3d408f6 commit 9c8ae81

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

secure_software_development_fundamentals.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1685,7 +1685,7 @@ The usual way to require a regex to match an entire input is to include *anchors
16851685

16861686
**ca[brt]**
16871687

1688-
In contrast, this regex will only match *exactly* the words “**cab**”, “**car**”, or “**cat**” in most regex implementations, because “**^**” often means *“match the beginning”* and “**$**” means *“match the end”*:
1688+
In contrast, this regex will only match *exactly* the words “**cab**”, “**car**”, or “**cat**” in many regex implementations, because “**^**” often means *“match the beginning”* and “**$**” often means *“match the end”*:
16891689

16901690
**^ca[brt]$**
16911691

@@ -1695,7 +1695,7 @@ In some implementations (depending on the option), “**^**” may mean *“begi
16951695

16961696
Regex notations are *not* the same between different languages and libraries. Almost every programming language has at least one good regex implementation and they all share many features. However, they are slightly different.
16971697

1698-
So, when you use a regex implementation you have not used before, look at its documentation every time you use an operation that you have not used before. Also, be careful when reusing a pattern.Here are some variations to look for.
1698+
So, when you use a regex implementation you have not used before, look at its documentation every time you use an operation that you have not used before. Also, be careful when reusing a pattern. Here are some variations to look for.
16991699

17001700
There are three major families of regex language notations:
17011701

@@ -1711,7 +1711,7 @@ There are three major families of regex language notations:
17111711

17121712
* Sometimes “**^**” matches the beginning of all the data, while in others it represents the beginning of any line in the data. This is often controlled by a *multiline* option.
17131713

1714-
* Sometimes “**$**” matches the end of all the data, while in others it represents the end of any line in the data. In some systems, an optional newline character (or similar) is also always accepted. In some systems you must use `\z` to match the end of the data, but in Python you must use `\Z`.
1714+
* Sometimes “**$**” matches the end of all the data, while in others it represents the end of any line in the data. In some systems, an optional newline character (or similar) is also always accepted. In some systems you must use "**\z**" to match the end of the data, but in Python you must use "**\Z**".
17151715

17161716
* The “**.**” for representing *“any character”* doesn’t always match the newline character (**\n**); often there is an option to turn this on or off.
17171717

0 commit comments

Comments
 (0)