I want to enter only digits in a textbox with the following condition
maximum 3 digits
maximum from 0 to 250..so 251 should not be accepted.
I have written the following code till now..how to take the other conditions too
this.value.match(/[^0-9]/g)
...
Html element contains complex & unique id, composed from namespace as prefix and incremented index - as postfix.
I try do it with wildcard expression for id.
If to use simple way without namespace, that it works fine:
$j("[id*=service_selected_]").click(function(){
...
In order to keep uniqueness,i need provide namespace part within...
Hi, Does anyone have any idea why the following code would output "no match"?
boost::regex r(".*\\.");
std::string s("app.test");
if (boost::regex_match(s, r))
std::cout << "match" << std::endl;
else
std::cout << "no match" << std::endl;
...
I have a string A and want to test if another string B is not part of it. This is a very
simple regex whose result can be inverted afterwards.
I could do:
/foobar/.test('[email protected]')
and invert it afterwards, like this:
!(/foobar/).test('[email protected]')
The problem I have is, that I need to do it within the regular expression ...
Hiya,
I currently do alot of data parsing, and have toyed with PHP functions for XML such as simple XML and a few others here and there.
But there always seems to be some sort of issue with dealing with them, mainly due to the way the data is presented.
The most reliable way i have found is to always just simply use preg_match_all a...
I have a regex I need to match against a path like so: "C:\Documents and Settings\User\My Documents\ScanSnap\382893.pd~". I need a regex that matches all paths except those ending in '~' or '.dat'. The problem I am having is that I don't understand how to match and negate the exact string '.dat' and only at the end of the path. i.e. I...
Using jQuery, I'd like to remove the whitespace and line breaks between HTML tags.
var widgetHTML = ' <div id="widget"> <h2>Widget</h2><p>Hi.</p> </div>';
Should be:
alert(widgetHTML); // <div id="widget"><h2>Widget</h2><p>Hi.</p></div>
I think the pattern I will need is:
>[\s]*<
Can this be accomplished without...
If I have a list with following elements
list[0] = "blach blah blah"
list[1] = "SELECT something"
list[2] = "some more text"
list[3] = "some more text"
How can I find the index of where the string starts with SELECT.
I can do list.indexOf("SELECT something");
But this is a dynamic list. SELECT something wont always be SELECT someth...
Hi,
I have some strings to check against a Regex pattern. Here is the regex:
apple(?!( ?not)).*?inc(\.|luded)?
string 1: "banana, rotten apple not included" - does not give me a match which is what I want.
string 2: "banana, rotten apple included" - produces a match which is what I want
But if I have a string like...
"banana, rott...
Hi all, a question about python regular expression.
I would like to match a div block like
<div class="leftTail"><ul class="hotnews">any news stuff</ul></div>
I was thinking a pattern like
p = re.compile(r'<div\s+class=\"leftTail\">[^(div)]+</div>')
but it seems not working properly
another pattern
p = re.compile(r'<div\s+class...
Hello,
I have a string with 
 in it the regex:
string value = Regex.Replace(textNode.Value, @"\s+", " ");
value = value.Replace("
", "");
value = Regex.Replace(value, @"\
", "");
value = value.Replace("\n", "");
didn't remove it.
How do I go about removing 
?
Note: It did function as a newline when added to a textbox.
T...
I am trying to remove/delete the second last character of a Tibetan script, as shown below (character in following example are of English):
$char = "ti.be.tan.|";
So I want to remove the "second last" character "." I tried in following way with my few knowledge of RE:
$char =~ s/.|$/|/g;
$char =~ s/[.|]$/|/g;
$char = tr/.|//d; ...
Hello,
I am looking at some sort of existing filter which can sanitize the user input to avoid XSS. Probably I can use htmlspecialchars for that. But at the same time I want to be able to parse all links (should match a.com, www.a.com and http://www.a.com and if it is http://www.aaaaaaaaaaaaaaaaaaaaaaaaaa.com then it should display it a...
I don't understand this Ruby code:
>> puts '\\ <- single backslash'
# \ <- single backslash
>> puts '\\ <- 2x a, because 2 backslashes get replaced'.sub(/\\/, 'aa')
# aa <- 2x a, because two backslashes get replaced
so far, all as expected. but if we search for 1 with /\\/, and replace with 2, encoded by '\\\\', why do we get this:
...
I have to do a redirect to another host if a certain parameter/value pair is in the querystring.
So far I have
RewriteCond %{REQUEST_URI}?%{QUERY_STRING} [&\?]abc=23&?
RewriteRule ^(.*)$ http://anotherserver.com/$1 [R,NC,L]
that works for
/index.php?id=95&abc=23 and
/index.php?abc=23&id=95 and
/index.php?id=95&abc=23&bla=123
but ...
I need 2 regular expressions that I will use in MySQL
OK if one of the url parameters equals something (e.g page_id=5)
I came up with this: ^https?:.*[?&]page_id=5([#&].*)?$
OK if a certain parameter is not present in the url (e.g do not match [?&]page_id=)
This is the one I need help with.
This functionality is part of a bigger pro...
I have created a CLR in a SQL server 2005 database. It is a simple regular expression user defined function that will check if a pattern exists in the string I pass into the function.
The dot net code I use in the CLR is shown below:
Return System.Text.RegularExpressions.Regex.IsMatch("Input", "pattern")
This returns a bit value of ...
This query concerns Yahoo Pipes only.
I want to search for a series of characters in a feed title, and when I've found it, I want to insert some text. Yahoo Pipe's regex module allows you to search and replace, but I don't want to search and replace, only search and insert. Does anybody know whether this is possible?
...
Morning all
I'm converting a site that I'm working on to be compliant with the latest version of PHP, so I'm going through and replacing all instances of ereg with their non-depreciated equivalent. However I was told about a handy built-in function with PHP called filter_var.
What my question is, is would it make sense to go with filte...
I'm trying to write a regex with named captures in C# to parse cron jobs. The problem, however, is that both using single quote and bracket named capture groups the values return blank. For example, with the input
*/15 * * * * * http://www.google.com/
this code:
Regex cronRe = new Regex(@"(?<minutes>[\d\*\-,]+) (?<hours>[\d\*\-,]+...