This question already has an answer here:
Reference - What does this regex mean?
(1 answer)
Closed 8 years ago.
[A-Za-z0-9'"-.:\\*?#/\\\\!_#$%&()\[\]{}=+\p{Space}]+
I am confused about the part '=+' of the regex. Does it signify one or more occurance of the character '+' only or + is treated as a character that may be contained by the string?
=+
is inside character class [] and so it has no special meaing and is treated as just literal characters.
Read more here
Related
This question already has answers here:
Regular Expression for getting everything after last slash [duplicate]
(7 answers)
Regular Expression to collect everything after the last /
(8 answers)
Closed 2 months ago.
Get The Last Characters end with (/) in include.
The input string is: xxx/xx/xxx/YERpq9CifKTIC1g
The result that I want: /YERpq9CifKTIC1g
Try:
/\/[^\/]+$/
The theory being to match a / followed by any character that isn’t a / ([^\/]) until the end of the line ($).
This question already has answers here:
how to fix - error: bad escape \u at position 0
(3 answers)
What special characters must be escaped in regular expressions?
(13 answers)
Closed 2 years ago.
I Have text and I want to use regex expression to find all words come after (Africa is):
my code
pattern = r'\africa\sis\s\w+'
re.findall(pattern,a)
the results should contain africa is (some words)
but I got this error
error: bad escape \i at position 0
This question already has answers here:
Understanding the negated character class
(3 answers)
Negative lookahead in regex to exclude percentage (%) in R
(3 answers)
Closed 2 years ago.
I have the string '05/'. If I write the pattern \d+[^\/]{1}, why does it still match the '05' part of the string? Shouldn't it be fully rejected since there is no match on the 3rd char requirement?
This question already has answers here:
Regex to match one or more characters
(2 answers)
Difference between * and + regex
(7 answers)
How to match "any character" in regular expression?
(12 answers)
Closed 5 years ago.
I have a regular expression for a 15-character limit:
/^([a-zA-Z0-9_]{1,15})$/
I would like to remove the character limit. How do I do this?
This question already has answers here:
Reference - What does this regex mean?
(1 answer)
Using explicitly numbered repetition instead of question mark, star and plus
(4 answers)
Closed 3 years ago.
I've been searching for a long time but didn't find an answer for my question, can tell me what the meaning of
(?:[-\w\d{1-3}]+\.)+
and not
(?:[-\w\d{1,3}]+\.)+
I don't understand the {1-3} part and can't find anywhere what it's mean.
Thank you
Everything between [] are characters to be matched. So it matches each of those characters:
- the literal character -
\w match any word character [a-zA-Z0-9_]
\d match a digit [0-9]
{ the literal character {
1-3 a single character in the range between 1 and 3
} the literal character }
the 1-3 makes no sense there, as well as the \d. Both are included in \w
Even what you would say that is correct {1,3} inside the [] makes no sense.