I want to make the textbox allow only three digits and three decimals.For example 999.999.similarly it doesnt allow any characters like a,b,/,etc.How can I do with the Jquery?
...
When I write Erlang programs which do text parsing, I frequently run into situations where I would love to do a pattern match using a regular expression.
For example, I wish I could do something like this, where ~ is a "made up" regular expression matching operator:
my_function(String ~ ["^[A-Za-z]+[A-Za-z0-9]*$"]) ->
....
I know...
Hey guys - I'm tearing my hair out trying to create a regular expression to match something like:
{TextOrNumber{MoreTextOrNumber}}
Note the matching number of open/close {}. Is this even possible?
Many thanks.
...
Hate coming up with titles. I need something that'll actually capture the following:
site.com/500/ (a number as the first param)
site.com/500/ABC/ (a number and a 3 letter code)
site.com/500/ABC/DEF/ (a number and 2x 3 letter codes)
What I have been messing with:
^(\d+/)?(\w{3}/)?(\w{3}/)?$
That sort of works but includ...
I'm looking for a simple regular expression to match the same character being repeated more than 10 or so times times, so for example if I have a document littered with horozntal lines:
=================================================
It will match the line of = characters because it is repeated more than 10 times.
Note that I'd lik...
Hi,
I am looking for a regular expression in PHP which would match the anchor with a specific text on it. E.g I would like to get anchors with text mylink like:
<a href="blabla" ... >mylink</a>
So it should match all anchors but only if they contain specific text So it should match these strings:
<a href="blabla" ... >mylink</a>
<a ...
I'm looking for the best reliable way to return the first and last name of a person given the full name, so far the best I could think of is the following regular expression:
$name = preg_replace('~\b(\p{L}+)\b.+\b(\p{L}+)\b~i', '$1 $2', $name);
The expected output should be something like this:
William -> William // Regex Fails
Will...
Hi,
I have a text file with multiple lines. I'll try to set a pattern to add a new carriage return in some lines of the text. This lines are like that:
lorem ipsum.
dolor sit amet, consectetur adipiscing elit [FIS] Donec feugiat
Well, the pattern is a line followed by other which has some characters and a '[' character too. If '[' is ...
I am trying to replace all numbers except for prices (numbers starting with $) with X in a body of text. I've been trying to use a look behind to get the job done, but it doesn't seem to work. Here is what I am using now:
$comments = preg_replace("/(?<!$)([0-9]+)/", "x", $comments);
This ends up just replacing all numbers with X inc...
i need to know if its safe to create a static Regex object like this
public static Regex s_Regex_ExtractEmails = new Regex(@"\b[A-Z0-9._%+-]+@(?:[A-Z0-9-]+\.)+[A-Z]{2,4}\b");
and call it staticaly from asp.net threads like this
s_Regex_ExtractEmails.Matches("my email is [email protected]")
wont this cause any problems?
i am doing this...
I am using the matches string builtin and need to run a regex pattern
(Views:).*?(span>)(.*?)(<\/div)
However, Freemarker freaks out because of the ">" character which is a special character in Freemarker. Any ideas how to get round this?
...
I'm writing a simple web crawler in Ruby and I need to fetch all href contents on the page. What is the best way to do this, or any other web page source parsing, since some pages might not be valid, but I still want to be able to parse them.
Are there any good Ruby HTML parsers that allow validity agnostic parsing, or is the best way j...
hi,
i trying to upload images to folder. here i need to upload only images like
.JPEG|.jpeg|GIF|.gif|.PNG|.png|bmp|.BMP
what is expression that we should write here so that when ever user tryis to upload thier files rather than this
any solution would be great
thank you
...
I'd like to know how to create a regex to validate a function like this:
=TRIMESTER(1,2,2008)
The first parameter should be any integer.
The second parameter is an integer that shouldn't be higher than 4.
The third parameter is a year (4 digits)
...
I'm very new to Ada, and I'm trying to do some simple work with some text. All I want to do is read in a file, and strip out anything that isn't a letter, space, or new line. so removing all the punctuation and numbers. In other languages I would just create a simple [^a-zA-Z] regular expression, look at each character and delete it i...
I want to remove all unnecessary commas from the start/end of the string.
eg; google, yahoo,, , should become google, yahoo.
If possible ,google,, , yahoo,, , should become google,yahoo.
I've tried the below code as a starting point, but it seems to be not working as desired.
trimCommas = function(s) {
s = s.replace(/,*$/, "");
s =...
To prefix unique words with "UNIQUE:" inside a file I've tried to use a perl regex command like:
perl -e 'undef $/;while($_=<>){s/^(((?!\b\3\b).)*)\b(\w+)\b(((?!\b\3\b).)*)$/\1UNIQUE:\3\4/gs;print $_;}' demo
On a demo file containing:
watermelon banana
apple pear pineapple orange mango
strawberry cherry
kiwi pineapple lemon cranberry...
Hi, i have a tricky problem and seems like i'm stuck. I have an idea how to proceed but no idea how to do it in practice.
What i want to do is convert a string inside .txt file to another format (using regex and variables?). The main problem is when i need to convert those lines marked with //comments.
NOTE: "...villainx calls $x" is c...
I've got a problem I need solved using Regex expressions; it involves taking a CSS selector and compiling a regex that matches the string representation of the nodes inside an HTML document. The point is to avoid parsing the HTML as XML and then either making Xpath or DOM queries to apply style attributes.
Does anyone know of a project ...
I want to restrict input to match the statement change = where word and value are both arbitrary words (sequences of characters that don't include spaces) and only one space exists (between the word "change" and a) in the input.
For example, "change variable=value" is valid but "change variable= value" and "change this" are not.
My att...