I'm trying to regex process id's based on parts of a process name. It seems to work if I only do a single word, but it fails when I try to do something like: find me any process with path /beginning ** /endswiththis/
Here's what I have so far:
QUEUE_PID="$(ps -ef | grep endswiththis | grep -v $0 | grep -v grep | awk '{ print $2 }')"; ...
Hey Friends,
I am using the following API for getting details of IMDB,http://www.deanclatworthy.com/imdb/?q=Star+Trek
while i using following API i am getting URL as following Output
http:\/\/www.imdb.com\/title\/tt0796366\/
how can i change it to
http://www.imdb.com/title/tt0796366/
in PHP?
...
In the spirit of polygenelubricants' efforts to do silly things with regular expressions,
I currently try to get the .NET regex engine to multiplicate for me.
This has, of course, no practical value and is meant as a purely theoretical exercise.
So far, I've arrived at this monster, that should check if the number of 1s multiplied by t...
I am using this pattern to remove all HTML tags (Java code):
String html="text <a href=#>link</a> <b>b</b> pic<img src=#>";
html=html.replaceAll("\\<.*?\\>", "");
System.out.println(html);
Now, I want to keep tag <a ...> (with </a>) and tag <img ...>
I want the result to be:
text <a href=#>link</a> b pic<img src=#>
How to do thi...
I'm trying to write a search and replace regex that will detect whether HTML that has been returned by a web request is complete. I have had cases when the server returns incomplete HTML (half of the page), so I want to detect that in the client and request the page again.
I was thinking the regex could look for the presence of <html[^...
Hi!
I have a string like a
"[echo]\r\n[echo] Building VARIANT_SETTINGS 05...\r\n[echo] VARIANT_SETTINGS file 1094_002-900208R7.0_05R01 02.hex successfully generated!\r\n"
How is it possible to get the 1094_002-900208R7.0_05R01 02.hex?
I tried to do this via Regex.Replace, but I don't understand well how it is happen. I tried
fileN...
I need to extract data from non delimited text files using C#. Basically, I need to remove all unwanted character then mark the end of a line and add a line break. Once the data has been separated into individual lines I need to loop through each line in turn and extract values using Regular Expressions. I have been doing this with Perl ...
in java regex,use [^x] to matching "not" with one char.
i want to know,how to matching more chars not?
i using [^789],it's not right.
String text="aa(123)bb(456)cc(789)dd(78)";
text=text.replaceAll("\\([^789].*?\\)","");
System.out.println(text);
i want get result is:
aabbcc(789)dd
how to fix my regex pattern?
thank...
Probably easy to do but I can't seem to generate the correct regex.
Say I have this string
$string = '<h2>Header 1</h2><p>ahs da sdka dshk asd haks</p><img src="http://dummyimage.com/100x100/" width="100" height="100" alt="Alt" /><h2>Header 2</h2><p>asdkhas daksdha kd ahs</p><em>Lame</em><p>trhkbasd akhsd ka dkhas</p><h2>Header 3</h2><...
Hi everybody,
i've already read all tha articles in here wich touch a similar problem but still don't get any solution working. In my case i wanna wrap each word of a string with a span. The words contain special characters like 'äüö...'
What i am doing at the moment is:
var textWrap = text.replace(/\b([a-zA-Z0-9ßÄÖÜäöüÑñÉéÈèÁáÀàÂâŶĈĉĜ...
Hi,
How do I write a regular expression which matches number-alphabets and commas only?
I came out with this one below but it doesnt work - it accepts other punctuation marks as well!
# check for matches number-alphabets and commas only
if(!preg_match('/([a-zA-Z0-9]|[a-zA-Z0-9\,])/', $cst_value))
{
$error = true;
echo '<erro...
I would like to test if user type only alphanumeric value or one "-".
hello-world -> Match
hello-first-world -> match
this-is-my-super-world -> match
hello--world -> NO MATCH
hello-world-------this-is -> NO MATCH
-hello-world -> NO MATCH (leading dash)
hello-world- ...
Hello,
I have a problem with preg_match_all.
While preg_match does reply the whole match as the first element of the array, preg_match_all doesn't - the first array is empty.
At least with the pattern I chose (havn't tried others since it's the one I need) it doesn't work.
Here is my code:
preg_match_all("/<\?\?(\t| )?translate(\t| )?...
Is there a simple trick to isolate the first sentence in a large string of text? (Perhaps using regular expressions.)
Searching for the first fullstop "." doesn't work, as acronyms such as "U.S.A." will screw things up.
(There probably is no right answer.)
...
I'm wondering a good way of splitting strings by a | delimiter if the input strings could be of the following form:
"foo, bar"
"foo ,bar"
"foo,bar"
"foo , bar"
"foo bar"
"foo,,bar"
So the only possible outputs strings are as:
"foo|bar"
"foo|bar|other|here"
Independently of how many terms are within the input string.
Any t...
Is there any regular expression library I can use with Sicstus Prolog VC9.4.1.1.? I am currently working under windows Vista.
Thanks,
Regards,
I.
...
Hi there,
i need to find inline javascript with php regex. I can find external script, but not inline, can anybody help me?
Here is my pattern for external:
"/<script(.*?)src(.*?)>(.*?)<\/script\s*>/smi"
Any ideas?
...
I was asked today if there was a library to take a list of strings and to compute the most efficient regex to match only those strings. I think it's an NP Complete problem by itself, but I think we can refine the scope a bit.
How would I generate and simplify a regex to match a subset of hosts from a larger set of all hosts on my networ...
Hi
let's say I have two xml strings:
String logToSearch = "<abc><number>123456789012</number></abc>"
String logToSearch2 = "<abc><number xsi:type=\"soapenc:string\" /></abc>"
String logToSearch3 = "<abc><number /></abc>";
I need a pattern which finds the number tag if the tag contains value, i.e. the match should be found only in t...
str = "some html code [img]......[/img] some html code [img]......[/img]"
I want use regex get the array:
["[img]......[/img]","[img]......[/img]"]
Any ideas anyone?
...