diff --git a/01-regular-expressions.html b/01-regular-expressions.html index 04f14f2a..46a5d2b9 100644 --- a/01-regular-expressions.html +++ b/01-regular-expressions.html @@ -484,7 +484,7 @@

Using special characters in regular expression matches -
+
organise
 organize
@@ -539,7 +539,7 @@ 

^[Oo]rgani.e\w*

-
+
organise
 Organize
@@ -571,7 +571,7 @@ 

[Oo]rgani.e\w+$

-
+
organiser
 Organized
@@ -603,7 +603,7 @@ 

^[Oo]rgani.e\w?\b

-
+
organise
 Organized
@@ -635,7 +635,7 @@ 

^[Oo]rgani.e\w?$

-
+
organise
 Organized
@@ -667,7 +667,7 @@ 

\b[Oo]rgani.e\w{2}\b

-
+
organisers
 Organizers
@@ -699,7 +699,7 @@ 

\b[Oo]rgani.e\b|\b[Oo]rgani.e\w{1}\b

-
+
organise
 Organi1e
@@ -757,7 +757,7 @@ 

Using square brackets

-
+
French
 France
@@ -790,7 +790,7 @@ 

Using dollar signs

-
+
French
 France
@@ -821,7 +821,7 @@ 

Introducing options

-
+
^France|^French

This will also find words where there were characters after @@ -847,7 +847,7 @@

Case insensitivity

-
+
\b[Cc]olou?r\b|\bCOLOU?R\b
 /colou?r/i
@@ -886,7 +886,7 @@

Word boundaries

-
+
\bhead ?rest\b

Note that although \bhead\s?rest\b does work, it will @@ -914,7 +914,7 @@

Matching non-linguistic patterns

-
+
0+[A-Za-z]{4}\b
@@ -937,7 +937,7 @@

Matching digits

-
+
\d{4}

Note: this will also match four-digit strings within longer strings @@ -962,7 +962,7 @@

Matching dates

-
+
\b\d{2}-\d{2}-\d{4}\b

Depending on your data, you may choose to remove the word @@ -988,7 +988,7 @@

Matching multiple date formats

-
+
\d{2}-\d{2}-\d{2,4}$

Note this will also find strings such as 31-01-198 at @@ -1017,7 +1017,7 @@

Matching publication formats

-
+
.* ?: .*, \d{4}

Without word boundaries you will find that this matches any text you @@ -1100,7 +1100,7 @@

Key Points

"identifier": "https://librarycarpentry.github.io/lc-data-intro/01-regular-expressions.html", "dateCreated": "2018-04-12", "dateModified": "2024-09-30", - "datePublished": "2024-12-17" + "datePublished": "2024-12-24" }