I'm trying to validate an ASP TextBox that can only have 1-2 digits (not zero) using the following regex:
^[1-9]{1,2}
This regex doesn't validate if the field is empty (assumed it would due to the 1-2 part)
Also tried ^[1-9+]{1,2} to no avail.
I'm clearly a newbie to regex so your help is appreciated.
These are my controls:
<asp:...
Had to deploy some PHP code onto a shared server with only PHP5.2.8. All code works EXCEPT for the preg_filter() call which was added in 5.3+ (and against which the code was written).
Can anyone recommend an easy substitute for preg_filter() in PHP5.2?
...
what's best solution using regex, to remove special characters from the begin and the end of every word.
"as-df-- as-df- as-df (as-df) 'as-df' asdf-asdf) (asd-f asdf' asd-f' -asdf- %asdf%s asdf& $asdf$ +asdf+ asdf++ asdf''"
the output should be:
"as-df-- as-df- as-df (as-df) as-df asdf-asdf) (asd-f asdf' asd-f' asd...
sed Expression 's/^.*EngineLog ERROR://'
...
I am still new to regex and I've run into a bit of a problem. I am building a parsing script and I need to to be able to pull out lines with a certain length out of a file.
How would I write a regex to match lines that have a certain number of words? Eg I want to match all lines in a file that have 3 words.
Could I extend that to find...
I'm looking for an Oracle Regular Expression that will match tokens in any order.
For example, say I'm looking for "one two".
I would want it to match both,
"one token two"
"two other one"
The number of tokens might grow larger than two, so generating the permutations for the regex would be a hassel.
Is there an easier way to do this...
I am getting an exception when I try to do a replaceAll:
Symbols is a valid string.
private String buildQuery(){
String query = "http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20yahoo.finance.quotes%20where%20symbol%20in%20(**QUERY**)&format=json&env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys&cal...
Hello everyone. I have a question regarding regular expressions in Python. The expressions are composed of data that would be read from a server, connected via socket. I'm trying to use and read wildcards in these expressions. Example: Let's say I run a chat server. When a message is recieved, the server sends to all clients (JSmith send...
I want the text "REPLACEME" to be replaced with my StringBuffer symbols. When I print symbols, it is a valid string. When I print my query, it still has the text REPLACEME instead of symbols. Why?
private String buildQuery(){
String query = "http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20yahoo.finance.quotes%...
Hi,
Given the following regular expressions:
- alice@[a-z]+\.[a-z]+
- [a-z]+@[a-z]+\.[a-z]+
- .*
The string [email protected] will obviously match all three regular expressions. In the application I am developing, we are only interested in the 'most specific' match. In this case this is obviously the first one.
Unfortunately th...
I need to match the following strings and returns the values as groups:
abctic
abctac
xyztic
xyztac
ghhtic
ghhtac
Pattern is wrote with grouping is as follows:
(?<arch>[abc,xyz,ghh])(?<flavor>[tic,tac]$)
The above returns only parts of group names. (meaning match is not correct).
If I use * in each sub pattern instead of $ at the ...
I have been trying to get my urls re-written. The first 4 rules are vital, but they are clashing with this line: (i think).
RewriteCond %{THE_REQUEST} ^[A-Z]+\ /([^.#?\ ]+)\.php([#?][^\ ]*)?\ HTTP/
this stops the url being able to be accessed like so www.example.com/page.php and redirects to www.example.com/page/
after adding the fir...
In flex, how to remove empty lines in text area?
...
Hi all, I've been pulling my hair out trying to come up with a regx that will pull the First and Last Name from the following HTML. My regex fu is not strong.
<span id="label_85110"><b>First Name</b></span>
<br/>
<span id="value_85110">AWeber- Email Parser</span>
<br/>
</p>
<p>
<span id="label_86004"><b>Last Name</b></span>
<...
I am trying to capture / extract numeric values from some strings.
Here is a sample string:
s='The shipping company had 93,999,888.5685 gallons of fuel on hand'
I want to pull the 93,999,888.5685 value
I have gotten my regex to this
> mine=re.compile("(\d{1,3}([,\d{3}])*[.\d+]*)")
However, when I do a findall I get the following...
Have I missed a standard API call that removes trailing insignificant zeros from a number?
Ex.
var x = 1.234000 // to become 1.234;
var y = 1.234001; // stays 1.234001
Number.toFixed() and Number.toPrecision() are not quite what I'm looking for.
...
Hi, I'm writing a log file parser in Perl, using regexes that I've stored in a database. My workflow is basically like this:
Looping over the file and searching
for patterns matching my regexes and
then extract them
Do something with these matches
Store them accordingly in a database
Last time I did this I explicitly wrote each rege...
Can anyone help me out with a Regex that will exclude words that are inside:
title = "EXCLUDE ANYTHING HERE"
THANKS!
...
Hey there. I am currently creating bbcode parsing engine and I have encountered a situation what i can't figure out on my own.
The thing is, that I popped into a problem exactly like this one:
http://stackoverflow.com/questions/3457039/apache-php-on-windows-crashes-with-regular-expression
That means that if i make something like the ex...
I'm using the 'e' modifier in preg_replace to search for a given string. Then I need it to look within that string for individual matches using another preg_replace statement:
$str = "This is FOO.";
$str = preg_replace('/(foo)/ie', "x$1", $str);
echo $str;
This will generate: This is xFOO.
Now I need to nest. (I'm nesting because I n...