diff --git a/README.md b/README.md index e8e60e3..e588cac 100644 --- a/README.md +++ b/README.md @@ -165,7 +165,7 @@ String ```python .replace(old_str, new_str) .split(sep=None, maxsplit=-1) -.strip() +.strip([chars]) .join() .startswith() # Pass tuple of strings for multiple options. .isnumeric() # True if str contains only numeric characters. @@ -180,7 +180,7 @@ print( [, , end='', sep='', file=]) # Use 'file=sys.stderr' for e ### Regex ```python import re -re.sub(, new, text, count=0) +re.sub(, new, text, count=0) # Substitutes all occurrences. re.search(, text) # Searches for first occurrence of pattern. re.match(, text) # Searches only at the beginning of the string. re.findall(, text) @@ -193,6 +193,8 @@ re.split(, text, maxsplit=0) # Use brackets in regex to keep the matches **Use '\\\\1' or r'\1' for backreference.** +**Use ? to make operators non-greedy.** + #### Special Sequences: ```python @@ -768,7 +770,6 @@ def eval_(node): ```

-
Libraries =========