Can some please help me with regular expression for height in cm ( eg. 170.25)(after dot only 2 character), weight in kg ( eg. 57.750) (after dot only 3 character),both numeric.
What is a regular expression for strings of 0 and 1 with an even number of zeros and an even number of ones?
I have something like (1*01*01*)*(0*10*10*)*.
Does it look good?
I want to write a regular expression that will replace the word Paris by a link, for only the word is not ready a part of a link.
Example:
i'm living <a href="Paris" atl="Paris link">in Paris</a>, near Paris <a href="gare">Gare du Nord</a>, i love Paris.
would become
i'm living.........near <a href="">Paris</a>..........i love <a href="">Paris</a>.
I need to find all substrings from a string that starting with a given string following with a left bracket and then any legal literal and then the right bracket. For example, a string is abcd(xyz)efcd(opq), I want to a function that returns "cd(xyz)" and "cd(opq)". I wrote a regular expression, but it returns only cd( and cd(...
I have text file, like
FILED AS OF DATE: 20090209
DATE AS OF CHANGE: 20090209
I need to find the position using FILED AS OF DATE: and read the date. I know how to do it using python strings. But using a regular expression seems cooler:)
Btw, how to parse the date?
Thanks!
<div class="hotelTitleZone">
<span class="componentTitle">
<a href="javascript:;" onclick="javascript:whocares();">Bellagio</a>
</span>
</div>
In above div tag want to get value "Bellagio" using regular expression
I want a Perl regular expression that will match duplicated words in a string.
Given the following input:
$str = "Thus joyful Troy Troy maintained the the watch of night..."
I would like the following output:
Thus joyful [Troy Troy] maintained [the the] watch of night...
Can someone give me a regular expression that will verify if all the letters in the word "cat" were also in the word "coating" in the proper sequence? So for the word "coating", the RegEx will test true for "cat" but false for "act".
hello,
is it, please, possible to use a regular expression with the php function array_key_exists(); like this for example :
$exp = "my regex";
array_key_exists($exp, $array);
thank you !
For example, these are valid math expressions:
a * b + c
-a * (b / 1.50)
(apple + (-0.5)) * (boy - 1)
And these are invalid math expressions:
--a *+ b @ 1.5.0 // two consecutive signs, two consecutive operators, invalid operator, invalid number
-a * b + 1) // unmatched parentheses
a) * (b + c) / (d // unmatched parentheses
I have no problem with matching float numbers, but have difficulty with parentheses matching. Any idea? If there is better solution than regular expression, I'll accept as well. But regex is preferred.
I'm having trouble finding a regular expression that matches the following String.
Korben;http://feeds.feedburner.com/KorbensBlog-UpgradeYourMind?format=xml;1
One problem is escaping the question mark. Java's pattern matcher doesn't seem to accept \? as a valid escape sequence but it also fails to work with the tester at myregexp.com. Here's what I have so far:
([a-zA-Z0-9])+;http://([a-zA-Z0-9./-]+);[0-9]+
Any suggestions?
Our server returns a custom 'X-Execution-Time' HTTP response header that returns in miliseconds the time between the server getting a request and our code returning a page, ie how long our code takes to run. I'm using JMeter to do some testing & I'd like to be able to report on this number of over time. I've setup this regular expression extractor: X-Execution-Time:\s(\d+) but I don't know how to get JMeter to report on this number per request so i can get a trend over time
Hi,
I need a regular expression to validate a timestamp of the format, using Javascript:
YYYY/MM/DD HH:MI:SS
I tried cooking up a few, but seems my regex skills fail to cover something or other.
Please give me a reference or way to do it.
P.S. : I mention regex, only as a suggestion. Im using Javascript and welcome any alternative.
Hi,
Can anybody help me writting a regular expression to replace these characters with a empty string. Character list is given below.
public static char[] delimiters = { ' ', '\r', '\n', '?', '!', ';', '.', ',', '`', ':', '(', ')', '{', '}', '[', ']', '|', '\'', '\\', '~', '=', '@', '>', '<', '&', '%', '-', '/', '#' };
Thanks.
Subrat.
A frequent issue in code reviews is whether a numeric value should be hard-coded in the code or not. Does anyone know of a nice regular expression that can catch 'magic numbers' in code like:
int overDue = 30;
Money fee = new Money(5.25D);
without also getting a ton of false positives like for loop initialization code?
for (int i = 0; i < array.length; i++) {
}
can any one tell me regular expression for postalcode of Amsterdam, Netherlands for validation
EX. 1113 GJ
Postal code format according to Wikipedia (thanks to Pekka):
1011–1199 plus a literal suffix AA-ZZ,
e.g. 1012 PP
Sorry for the potentially dumb question but I am trying to pull together a regular expression that will allow:
A number with 1 or 2 numbers before a decimal point, and 0-6 numbers after the decimal point. However I also need to allow the field to be blank if so required.
Valid Examples
0.952321
1.20394
12.12
25
Blank
Invalid Examples
123.45678
1.1234567
Please can anyone help?
I was performing a code review for a colleague and he had a regular expression that looked like this:
if ($value =~ /^\d\d\d\d$/) {
#do stuff
}
I told him he should change it to:
if ($value =~ /^\d{4}$/) {
#do stuff
}
To which he replied that he preferred the first for readability (I find the second more readable, but that's a religious debate I'll save for another day).
My question: is there an actual benefit to one over the other?
Related to my previous question, I have a string on the following format:
this {is} a [sample] string with [some] {special} words. [another one]
What is the regular expression to extract the words within either square or curly brackets, ie.
{is}
[sample]
[some]
{special}
[another one]
Note: In my use case, brackets cannot be nested. I would also like to keep the enclosing characters, so that I can tell the difference between them when processing the results.
I need to be able to download some file from a regular site using my proxy server,
I already try this:
System.Net.WebClient client = new System.Net.WebClient();
client.Proxy = new WebProxy(ip, port);
client.DownloadFile(url);
but it's not works at all, I don't know what I missed,(without a proxy it works)
thanks,
Dani.
I have texts like this one:
this is a text in [lang lang="en" ]english[/lang] or a text in [lang lang="en" ]spanish[/lang]
I need to substitute them for:
this is a text in <span lang="en">english </span> or a text in <span lang="es">spanish</span>
I need a regular expression, not a simple replace. The languages in the lang tag can be whatever.
If you have a fair number of regular expressions used by both client (javascript) and server side code (C#, vb.net) and want to store them in one place to avoid duplication, where do you store them?
I could use registerscript and write out the regex as strings, but just wondering if there is something more elegant.