I have a regular expression in PHP that looks for the date in the format of YYYY-MM-DD
What I have is: [\d]{4}-[\d]{2}-[\d]{2}
I'm using preg_match to test the date, the problem is that 2009-11-10 works, but 2009-11-1033434 works as well. It's been awhile since I've done regex, how do I ensure that it stops at the correct spot? I've ...
I am working with jqDock on a DotNetNuke project. I ran jQuery.noConflict() and went through the jqDock.js file and changed all '$' to 'jQuery' (though I don't think it was necessary).
In this little bit of code I have an issue:
altImage : function(){
var alt = jQuery(this).attr('alt');
return (alt && alt.match(/\.(gif|jpg|...
I need a very specific function in PHP. Basically, I have two strings as arguments, one of which is a pattern that contains wildcards of variable length (*), and one of which is a string that matches that pattern. I need to get an array of the strings from the latter string that fill in the wildcards in the pattern.
For example:
Arg...
Is there a DOTALL matching flag for boost::regex? The documentation shows:
static const match_flag_type match_not_dot_newline;
static const match_flag_type match_not_dot_null;
but no mention of regular DOTALL.
I'm trying to match a python regular expression written as
re.compile(r'<a(.*?)</a>', re.DOTALL)
...
im having a variable that is containing some links. Now i want to check that which link is clicked and hae to remove its anchor tag so that people can come to know that which tab has been clicked.
this is the example of the data :-
<a href="#" onclick="sort_data('All','all')">All</a> | <a href="#" onclick="sort_data('Diversified','1')"...
The above expression is working fine. this expression means first leter should start with characters only not a digit, remaining letters alphanumarics. but it not allow when i give underscore like "s_sasi" it is giving error message can u help me i want to allow the underscore also in that expression thank u
...
in my webapplication i have user registration page, in that one textbox contain House No:
user has to enter houseno in that textbox. i that user can enter all numarics or all alphabets or all alphanumarics but not all special characters how can i restrict the user not to enter all special characters like
user can enter
123455 or
abcd...
I have a C file which I copied from somewhere else, but it has a lot of comments like below:
int matrix[20];
/* generate data */
for (index = 0 ;index < 20; index++)
matrix[index] = index + 1;
/* print original data */
for (index = 0; index < 5 ;index++)
How can I delete all the comments enclosed by /* and */. Sometimes, the comment...
I need to be able to tell the difference between a string that can contain letters and numbers, and a string that can contain numbers, colons and hyphens.
>>> def checkString(s):
... pattern = r'[-:0-9]'
... if re.search(pattern,s):
... print "Matches pattern."
... else:
... print "Does not match pattern."
# 3 Numbers sep...
Hi,
I'd like to find good way to find some (let it be two) sentences in some text. What will be better - use regexp or split-method? Your ideas?
As requested by Jeremy Stein - there are some examples
Examples:
Input:
The first thing to do is to create the Comment model. We’ll create this in the normal way, but with one small diffe...
Hi All,
Does anyone have a c# variation of this?
This is so I can take some html and display it without breaking as a summary lead in to an article?
http://stackoverflow.com/questions/1193500/php-truncate-html-ignoring-tags
Save me from reinventing the wheel!
Thank you very much
---------- edit ------------------
Sorry, new here, ...
Hi i need to search a string with in paragraph .Here the string may be a java regex .
How do i differentiate a regex and a ordinary string.
Please give some suggestions to achieve this?
...
I modified a regex I got here. I needed to change it because I needed it to match the following additional criteria:
Dates with only Month and Year
Full dates in the form mm dd, yyyy
Dates with year only
Input with extraneous info (like Vol. 51, No. 1, Mar 2008)
This is what I have so far. I did this with RegexBuddy to help me parse ...
How do I match French and Russian Cyrillic alphabet characters with a regular expression? I only want to do the alpha characters, no numbers or special characters. Right now I have
[A-Za-z]
...
This page has a great example using REGEXP to do pattern matching. the problem with REGEXP won't match the following strings:
"Mr John"
"Dr. John"
or even:
"Mr. John Doe"
with the string "John Doe"
I would like to know how do I get positive matches for any of the given examples?
Here is a sample code:
Drop table Names;
CREATE ...
I have a String like the following one:
"some value is 25 but must not be bigger then 12"
I want to extract the two numbers from the string.
The numbers are integers.
There might be no text before the first number and some text after the second number.
I tried to do it with a regexp and groups, but failed miserably:
public Mes...
I need to be able to extract a string between 2 tags for example: "00002" from "morenonxmldata<tag1>0002</tag1>morenonxmldata"
In using C# and .NET 3.5.
...
Hello,
I am looking for a regex query to verify a name of file and make sure that it contains only English characters, numbers or these characters [,],-, _
However it should not allow characters like these:
ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ¿ÿ³J
Thanks
...
hi, i'm new to regular expressions and would like to match the first and last occurrences of a term in php. for instance in this line:
"charlie, mary,bob,bob,mary, charlie, charlie, mary,bob,bob,mary,charlie"
i would like to just access the first and last "charlie", but not the two in the middle. how would i just match on the first and...
I have a regex that looks like this
((1010xxx)?(\d{11}|\d{10}|\d{7})+)
Basically I want it to match
8085551234
5551234
10102338085551234
and it should fail on
1010233
This is more for validation being done on an xsd than an actual matcher.
PS.
I am trying to match US telephone numbers 7 - 11 digits long with an optional 1010xx...