Regex Basics Flashcards
Backslash \
escapes the character
The Pipe |
Or
The Question mark ?
The last item is optional, betyder att nåt får komma 0 eller 1 gång
Parentheses
Used when you want to match several outcomes
Square brackets []
Match only one out of a set or a range of characters
Braces {}
When you want to repeat the last item, or set a range how of the minimum and maximum repeats
The Dot .
Match any character except linebreaks
The + Sign
Matches one or more of the former items, betyder att nåt måste komma minst en gång
The * sign
Stars will match zero or more of the previous items, betyder ingenting eller hur mycket som helst
The .* Sign
get everything.
The Caret ^
match only strings that start exactly with
The Caret in brackets [^0-9]
match only characters that are not right after the caret.
The dollar sign $
don’t match if the target string has any characters beyond where I have placed the dollar sign
\w
word
\d
digit