animator / learn-python

📖🐍 Free & Open Source book to master Python 3. Also available: PDF & Web Interface.
https://animator.github.io/learn-python/
Creative Commons Attribution Share Alike 4.0 International
328 stars 209 forks source link

RegEx in Python Tutorial addition #1221

Closed Damini2004 closed 3 months ago

Damini2004 commented 3 months ago

This feature help user to know more about the module of RegEx. The re module in Python provides powerful tools for working with regular expressions, enabling advanced text pattern matching and manipulation. Key functions include:

re.compile(): Compiles a pattern for reuse. re.search(): Searches for the first match in a string. re.match(): Matches a pattern at the beginning of a string. re.fullmatch(): Matches an entire string. re.split(): Splits a string by a pattern. re.findall(): Finds all non-overlapping matches. re.finditer(): Returns an iterator over all matches. re.sub(): Replaces occurrences of a pattern. re.subn(): Similar to re.sub(), but also returns the number of replacements made. Special characters and sequences (like ., ^, $, *, etc.) enhance pattern matching. Flags (e.g., re.IGNORECASE) modify matching behavior, making re indispensable for text processing tasks.

ashitaprasad commented 3 months ago

Content already present .. you can raise a new issue to improve it. https://github.com/animator/learn-python/blob/main/contrib/advanced-python/regular_expressions.md