Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- https://regexone.com/
- abc… Letters
- 123… Digits
- \d Any Digit
- \D Any Non-digit character
- . Any Character
- \. Period
- [abc] Only a, b, or c
- [^abc] Not a, b, nor c
- [a-z] Characters a to z
- [0-9] Numbers 0 to 9
- \w Any Alphanumeric character
- \W Any Non-alphanumeric character
- {m} m Repetitions
- {m,n} m to n Repetitions
- * Zero or more repetitions
- + One or more repetitions
- ? Optional character
- \s Any Whitespace
- \S Any Non-whitespace character
- ^…$ Starts and ends
- (…) Capture Group
- (a(bc)) Capture Sub-group
- (.*) Capture all
- (abc|def) Matches abc or def
- https://www.linguisticsweb.org/doku.php?id=linguisticsweb:tutorials:basics:regex:regex-notepad
- RegEx Effect Example
- a Find character ‘a’
- abc Find string abc
- […] Find any of ‘…’ [abc] finds characters ‘a’, ‘b’, or ‘c’
- [a-z] Find any in the range from ‘a’ to ‘z’ [a-f] finds any of the lowercase letters ‘a’ to ‘f’
- [^x] Find anything that is not ‘x’ [^aeiou] Finds all characters that are not vowels, including punctuation, digits and whitespace
- ? The previous element is optional, [1-9][0-9]? Finds numbers from 1 to 9 and 10 to 99
- it does not have to occur
- . Find any character except newline,
- linefeed, carriage return
- + Find the previous element 1 to many times r+ finds ‘r’, rr, rrr, rrrr, etc.
- * Find the previous element 0 to many times [a-zA-Z]*ed finds strings ending in ed
- {x,y} Repeat the previous element x to y times [0-9]{5,7} Finds any sequence of 5 to 7 digits.
- (…) Save anything inside the parentheses for (store this) finds and stores the string store this
- use in replacement
- \1 \2 \3 Restore the string saved by the \1ing adds ing to the saved string
- parentheses, for use in replacement
- \w Shortcut for word characters \w* finds cat, dog, login_name, cutie17, etc.
- (letters, digits and underscores)
- \d Shortcut for digits, same as [1-9]
- \b Marks the beginning or end of a word
- \ Escape the operator following ‘\’ \[\w*\] finds a word in brackets
- ALT Kody:
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement