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
Related
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 3 days ago.
Improve this question
How to change comma to period when typing double number in TextField?
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:
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 think I saw something on using this to truncate test as a filter, but I've seen to no idea how to use it. Using as xx|do_trucate(20) gives the following:
TemplateAssertionError: no filter named 'do_truncate'
What is the correct usage?
Doh, from the spec I saw
do_trucate
http://code.nabla.net/doc/jinja2/api/jinja2/jinja2.filters.html
But in reality, its just truncate
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 >)
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?