Regex does not match url with www [closed] - regex

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 8 years ago.
Improve this question
I'm trying to write a regex that can match both following lines:
http://ficsgames.org/cgi-bin/show.cgi?ID=364189186;action=save
http://www.ficsgames.org/cgi-bin/show.cgi?ID=364189186;action=save
I've got this:
http:\/\/(www)?ficsgames\.org\/cgi-bin\/show\.cgi\?ID=[0-9]+;action=save
but it doesn't seem to work - http://regex101.com/r/vB2cM3/1

You are missing a dot . inside of your optional group.
(www\.)?

You're missing a \. in your (www)?

You forgot the . after www. (which needs to be escaped)
I've updated your regex link here:
http://regex101.com/r/vB2cM3/4

Related

why does [[:xdigit:]] highlight letter e in grep results? [closed]

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 2 years ago.
Improve this question
Why does below command highlight e as well with digits?
grep '[[:xdigit:]]' search.txt
This is intended, as it searches for hexadecimal digits.
The man-page states:

Why does this regex pattern fail to match the string [closed]

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 5 years ago.
Improve this question
I am trying to match a date string, and have tested out my pattern on regex101. I think I am following the regex rules, but I'm obviously missing something, and the pattern is not matching the string.
My regex pattern is: \s?(Mon|Tue|Wed|Thurs|Fri)day\s\d{0,2}(st|nd|rd|th)\s (January|February|March|April|May|June|July|August|September|October|November|December)\,\s\d{4}
The string I'm trying to match is:
Monday 16th October, 2017
Which can appear in the document with or without lead/trailing whitespace(s).
Why is the pattern not matching?
By copying your regex from your post, I saw there's a redundant space here:
(st|nd|rd|th)\s (January|
↑
I'm not sure if it's a formation problem or not. Anyway, remove it and you should be fine.
Suggestion:
Depending on the language you're using (was tagged Python), use a library that parses the string for you, instead of having this (ugly) regex.

Perl matching string with mix of alphanumeric,_ and any number of square braces [closed]

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 6 years ago.
Improve this question
How do I match a string with " alphanumeric characters, underscore and any number of open and closed square braces ".
Example : " CDN_MBIT_hresp_s_reg[0]_MB_hresp_s_reg[1]bbjabs_chiansmokrs[6] "
I tried $line=~/[a-zA-Z0-9_/[/]]/;
This seems doesn't work.
P.S. This question is quite similar to Regex Matching Square Brackets
but not same
Thank you in advance.
Wrong slash used for escaping.
/[a-zA-Z0-9_\[\]]/
Alternatively, you could simply use
/[\w\[\]]/
Both of those match exactly one character. If you wanted to capture the string, you'd want
/([\w\[\]]+)/

probleming in generating corresponding string for a regex [closed]

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 7 years ago.
Improve this question
I have a program with regex as:
"\\s*(\\d{1,5})?\\s*(?:<(?<pri>\\d{1,3})>)"
I need to test the matching pattern thus I am trying a corresponding string which matches the expression.
can you provide an example of string that matches the above regex?
23123<123>
123 <1>
123 <123>
123<12>
<123>
<1>
Something of this sort.See demo.
https://regex101.com/r/sJ9gM7/75
<space>(0 or more)<integer>(1 to 5 may or may not be there)<space>(0 or more)<(Symbol <)<integer>(1 to 3)>(symbol >)

Notepad++ and regex [closed]

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 8 years ago.
Improve this question
I am doing some test with Find in Notepad++ using regex. Here is my problem that I can't figure out why:
My text is:
abc/xyz/p234/s-sdf
The following regex matches well:
[a-z]+/[a-z]+(/p[0-9]+)/s-[a-z]+
But why the following regex (with an added '?') does not match anymore:
[a-z]+/[a-z]+(/p[0-9]+)?/s-[a-z]+
Am I right that in the last regex, the '?' means that (/p[0-9]+) can appear zero or one time?