Notepad++ and regex [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 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?

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:

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\[\]]+)/

capture numbers between two characters in R [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
I need to capture cpu usage data from this string, in this cast cpu usage is 1.55. Values between - and %
cpu<-c("CPU Usage: u814.13 s13.33 cu0 cs0 - 1.55% CPU load")
I have tried this:
as.numeric(gsub("^.*- ([0-9]+).*$", "\\1", cpu))
It is giving 1.
Any ideas what I'm doing wrong here?
([\d\.]+)% CPU.*$
You didn't include the decimal dot in the square brackets

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 >)

Regex does not match url with www [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'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