From 279ae369d6d751f8ceb39b534e3d63a67082caac Mon Sep 17 00:00:00 2001 From: Anjali Silva <25417593+anjalisilva@users.noreply.github.com> Date: Fri, 13 Mar 2026 12:51:51 -0500 Subject: [PATCH] Modify print statements for regex replacement example Updated print statements to reflect changes in the replacement text from 'python' to 'JavaScript'. --- 18_Day_Regular_expressions/18_regular_expressions.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/18_Day_Regular_expressions/18_regular_expressions.md b/18_Day_Regular_expressions/18_regular_expressions.md index b8b934e7e..b67fbffc1 100644 --- a/18_Day_Regular_expressions/18_regular_expressions.md +++ b/18_Day_Regular_expressions/18_regular_expressions.md @@ -179,10 +179,10 @@ txt = '''Python is the most beautiful language that a human being has ever creat I recommend python for a first programming language''' match_replaced = re.sub('Python|python', 'JavaScript', txt, re.I) -print(match_replaced) # JavaScript is the most beautiful language that a human being has ever created.I recommend python for a first programming language +print(match_replaced) # JavaScript is the most beautiful language that a human being has ever created.I recommend JavaScript for a first programming language # OR match_replaced = re.sub('[Pp]ython', 'JavaScript', txt, re.I) -print(match_replaced) # JavaScript is the most beautiful language that a human being has ever created.I recommend python for a first programming language +print(match_replaced) # JavaScript is the most beautiful language that a human being has ever created.I recommend JavaScript for a first programming language ``` Let us add one more example. The following string is really hard to read unless we remove the % symbol. Replacing the % with an empty string will clean the text.