Skip to content

Commit

Permalink
Fix error per issue #36 (#88)
Browse files Browse the repository at this point in the history
Signed-off-by: David A. Wheeler <[email protected]>

Signed-off-by: David A. Wheeler <[email protected]>
  • Loading branch information
david-a-wheeler authored Oct 11, 2022
1 parent 2cbafa2 commit 8a1d39b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion secure_software_development_fundamentals.md
Original file line number Diff line number Diff line change
Expand Up @@ -1548,7 +1548,7 @@ A regex pattern is usually a sequence of rules, stated one after the other. For

In fact, by default, regexes *search* for the given pattern in a string. That is, normally a regex implementation will see if a pattern matches some text if it starts at the first character, then second character, and so on, reporting if it can find *any* match. So the pattern “**ca[brt]**” will also match “**abdicate**” because there is a “**cat**” in the word “**abdicate**”.

Regular expressions can do much more, though. If you follow a pattern with “**&#42;**”, that means “*0 or more times*”. So the regex pattern “**a&#42;b&#42;x**” describes a pattern of 0 or more **a**’s, followed by 0 or more **b**’s, followed by **x**. This pattern matches strings like “**aabx**”, “**bbbx**”, and “**abx**”, but not “**bax**” or “**aabb**”. Most regex implementations also support “**+**” for “*1 or more times*” and “**?**” for “*0 or 1 times*”. Most regex implementations also let you use parentheses to group expressions, for example, “**f(abc)&#42;d**” matches if there is an “**f**”, followed by 0 or more instances of the sequence “**abc**”, followed by the letter “**d**”.
Regular expressions can do much more, though. If you follow a pattern with “**&#42;**”, that means “*0 or more times*”. So the regex pattern “**a&#42;b&#42;x**” describes a pattern of 0 or more **a**’s, followed by 0 or more **b**’s, followed by **x**. This pattern matches strings like “**aabx**”, “**bbbx**”, and “**abx**”, but not “**aabb**”. Most regex implementations also support “**+**” for “*1 or more times*” and “**?**” for “*0 or 1 times*”. Most regex implementations also let you use parentheses to group expressions, for example, “**f(abc)&#42;d**” matches if there is an “**f**”, followed by 0 or more instances of the sequence “**abc**”, followed by the letter “**d**”.

You can usually do a case-insensitive match through some option. Make sure you set the locale if you use case-insensitive matching, since different languages have different rules, and sometimes the rules can be complex. For example, in German the lowercase “sharp-s” character “**ß**” is equivalent to the uppercase “**SS**” when using a case-insensitive match. In some cases, you may only want to do “*ASCII case-insensitive matching*”; this compares a sequence of code points as if all ASCII code points in the range 0x41 to 0x5A (A to Z) were mapped to the corresponding code points in the range 0x61 to 0x7A (a to z).

Expand Down

0 comments on commit 8a1d39b

Please sign in to comment.