Hello list :)
Just a short question which I know it should be easy, but I'm no expert yet
in regular expressions.
I've got a nice little XML string, which is something like this but can be
changed:
?xml version=1.0 encoding=utf-8?
boolean xmlns=http://tempuri.org/;false/boolean
The boolean
Camilo,
What exactly are you trying to achieve? Meaning:
if (true)
do this;
if (false)
do that;
However, here's a link that I used long back to help me with some RegEx :
http://www.gskinner.com/RegExr/
Regards,
Shreyas
On Wed, Aug 18, 2010 at 11:31 PM, Camilo Sperberg
On Wed, 2010-08-18 at 23:36 +0530, Shreyas Agasthya wrote:
Camilo,
What exactly are you trying to achieve? Meaning:
if (true)
do this;
if (false)
do that;
However, here's a link that I used long back to help me with some RegEx :
http://www.gskinner.com/RegExr/
Regards,
On Wed, Aug 18, 2010 at 15:01, Ashley Sheridan a...@ashleysheridan.co.ukwrote:
On Wed, 2010-08-18 at 23:36 +0530, Shreyas Agasthya wrote:
Camilo,
What exactly are you trying to achieve? Meaning:
if (true)
do this;
if (false)
do that;
However, here's a link that I used long back
Hi, I'm looking for some ideas on the best way to parse blocks of text
that is formatted such as:
$sometext %\r\n -- good data
$otherstring %\r\n -- good data
$andyetmoretext %\r\n
On Mon, Dec 22, 2008 at 15:56, Rene Fournier renefourn...@gmail.com wrote:
Each line should start with a $dollar sign, then some arbitrary text, ends
with a percent sign, followed by carriage-return and line-feed. Sometimes
though, the final line is not complete. In that case, I want to save
Rene Fournier wrote:
Hi, I'm looking for some ideas on the best way to parse blocks of text
that is formatted such as:
$sometext %\r\n-- good data
$otherstring %\r\n-- good data
$andyetmoretext %\r\n-- good data
2008/12/22 Jim Lucas li...@cmsws.com:
Rene Fournier wrote:
Hi, I'm looking for some ideas on the best way to parse blocks of text
that is formatted such as:
$sometext %\r\n-- good data
$otherstring %\r\n-- good data
$andyetmoretext %\r\n
it. I tried the code you posted, for now it is blocking
blank fields.
Thank you
- Original Message
From: Richard Lynch [EMAIL PROTECTED]
To: Adil Drissi [EMAIL PROTECTED]
Cc: php-general@lists.php.net
Sent: Tuesday, March 4, 2008 3:09:09 PM
Subject: Re: [PHP] regular expressions
PROTECTED]
To: Adil Drissi [EMAIL PROTECTED]
Cc: php-general@lists.php.net
Sent: Tuesday, March 4, 2008 3:09:09 PM
Subject: Re: [PHP] regular expressions question
On Tue, March 4, 2008 1:19 pm, Adil Drissi wrote:
Is there any way to limit the user to a set of characters for example
say i want my user
- Original Message
From: Richard Lynch [EMAIL PROTECTED]
To: Adil Drissi [EMAIL PROTECTED]
Cc: php-general@lists.php.net
Sent: Tuesday, March 4, 2008 3:09:09 PM
Subject: Re: [PHP] regular expressions question
On Tue, March 4, 2008 1:19 pm, Adil Drissi wrote:
Is there any way
Hi,
Is there any way to limit the user to a set of characters for example say i
want my user to enter any character between a and z (case insensitive). And if
the user enters just one letter not belonging to [a-z], this will not be
accepted.
I tried eregi('[a-z]', $fname) but this allows the
On 3/4/08, Adil Drissi [EMAIL PROTECTED] wrote:
Hi,
Is there any way to limit the user to a set of characters for example say i
want my user to enter any character between a and z (case insensitive). And
if the user enters just one letter not belonging to [a-z], this will not be
accepted.
On Tue, Mar 4, 2008 at 2:19 PM, Adil Drissi [EMAIL PROTECTED] wrote:
Hi,
Is there any way to limit the user to a set of characters for example say i
want my user to enter any character between a and z (case insensitive). And
if the user enters just one letter not belonging to [a-z], this
On Tue, March 4, 2008 1:19 pm, Adil Drissi wrote:
Is there any way to limit the user to a set of characters for example
say i want my user to enter any character between a and z (case
insensitive). And if the user enters just one letter not belonging to
[a-z], this will not be accepted.
I
Thank you guys,
The answers you gave me not only solved the problem,
but i included more characters like space and -.
Thank you again
--- Richard Lynch [EMAIL PROTECTED] wrote:
On Tue, March 4, 2008 1:19 pm, Adil Drissi wrote:
Is there any way to limit the user to a set of
characters for
At 2:04 AM -0500 12/12/07, Robert Cummings wrote:
?php
if( strlen( $pw1 ) 6
||
!ereg( '[[:digit:]]', $pw1 )
||
strlen( ereg_replace( '[^[:alpha:]]', '', $pw1 ) ) 2
||
strlen( ereg_replace( '[[:alnum:][:space:]]', '', $pw1 ) ) 1 )
{
// error message
}
?
Cheers,
I am trying to do a password match with php..
It needs to be at least 6 characters, contains 2 alphabets and at least 1
number or a special character...
if
(!preg_match(/^.*(?=.{6,})((?=.*\d)|(?=.*[,[EMAIL
PROTECTED]\/'+\*\?\.\[\]\^$\(\){}\|\\:;'~`#%_-]))([a-zA-Z]{2,}).*$/,
$pw1)) {error
On Tue, 2007-12-11 at 22:33 -0800, Liz Kim wrote:
I am trying to do a password match with php..
It needs to be at least 6 characters, contains 2 alphabets and at least 1
number or a special character...
if
(!preg_match(/^.*(?=.{6,})((?=.*\d)|(?=.*[,[EMAIL
There was no escaping in the original either.
Also, I did assume that the list of replacements would grow to become
pretty large. I wouldn't suggest doing this for a small list such as
that given in the example.
Robert Cummings wrote:
On Wed, 2007-11-07 at 14:33 +, Mark Summers wrote:
On Wed, 2007-11-07 at 14:53 +, Mark Summers wrote:
There was no escaping in the original either.
Also, I did assume that the list of replacements would grow to become
pretty large. I wouldn't suggest doing this for a small list such as
that given in the example.
Given that you expect
This is a much better solution. I didn't realise that str_replace()
accepted arrays as arguments for the search and replace terms.
Mental note: reading mailing lists backwards doesn't work.
Robert Cummings wrote:
On Tue, 2007-11-06 at 23:24 -0300, Martin Alterisio wrote:
2007/11/6,
On Wed, 2007-11-07 at 14:33 +, Mark Summers wrote:
This is a first attempt but the general idea is that the regular
expression matching is done in one operation and then str_replace() is
called only as many times as required instead of once for every line in
your list. Also, str_replace()
This is a first attempt but the general idea is that the regular
expression matching is done in one operation and then str_replace() is
called only as many times as required instead of once for every line in
your list. Also, str_replace() is faster than ereg_replace().
?php
$replace = array(
I'm a mess in regular expressions and I make this code:
$link = ereg_replace('ntilde;','n',$link);
$link = ereg_replace('aacute;','a',$link);
$link = ereg_replace('eacute;','e',$link);
$link = ereg_replace('iacute;','i',$link);
$link = ereg_replace('oacute;','o',$link);
$link =
Maybe this helps
?php
$line = preg_replace_callback(
'/(aacute;|eacute;|iacute;|oacute;|uacute;|ntilde;)/',
create_function(
// single quotes are essential here,
// or alternative escape all $ as \$
'$matches',
you could do it without any function
?php
$line = Hola que tal con aacute; con acento y entilde;e \n;
echo preg_replace('/([aeioun])(acute|tilde);/i','\1',$line);
?
On Nov 6, 2007 2:44 PM, Ezequiel Gutesman [EMAIL PROTECTED]
wrote:
Maybe this helps
?php
$line = preg_replace_callback(
True, but you'll have to change the rexex not to match, 'nacute;' or
'atilde; for example (unless you want it)
Thiago Ferreira wrote:
you could do it without any function
?php
$line = Hola que tal con aacute; con acento y entilde;e \n;
echo
Alberto García Gómez wrote:
I'm a mess in regular expressions and I make this code:
$link = ereg_replace('ntilde;','n',$link);
$link = ereg_replace('aacute;','a',$link);
$link = ereg_replace('eacute;','e',$link);
$link = ereg_replace('iacute;','i',$link);
$link =
2007/11/6, Alberto García Gómez [EMAIL PROTECTED]:
I'm a mess in regular expressions and I make this code:
$link = ereg_replace('ntilde;','n',$link);
$link = ereg_replace('aacute;','a',$link);
$link = ereg_replace('eacute;','e',$link);
$link = ereg_replace('iacute;','i',$link);
$link =
On Tue, 2007-11-06 at 23:24 -0300, Martin Alterisio wrote:
2007/11/6, Alberto García Gómez [EMAIL PROTECTED]:
I'm a mess in regular expressions and I make this code:
$link = ereg_replace('ntilde;','n',$link);
$link = ereg_replace('aacute;','a',$link);
$link =
Robert Cummings wrote:
On Tue, 2007-11-06 at 23:24 -0300, Martin Alterisio wrote:
2007/11/6, Alberto García Gómez [EMAIL PROTECTED]:
I'm a mess in regular expressions and I make this code:
$link = ereg_replace('ntilde;','n',$link);
$link = ereg_replace('aacute;','a',$link);
$link =
On Tue, 2007-11-06 at 20:15 -0800, Jim Lucas wrote:
Robert Cummings wrote:
On Tue, 2007-11-06 at 23:24 -0300, Martin Alterisio wrote:
2007/11/6, Alberto García Gómez [EMAIL PROTECTED]:
I'm a mess in regular expressions and I make this code:
$link = ereg_replace('ntilde;','n',$link);
Hi all, am trying to run a regular expression to a list of user entered data on
some forms.
I've creating what i think is a matching pattern for each category as shown
below:
function validateEntry($regularExpression, $fieldValue)
{
if(preg_match($regularExpression, $fieldValue))
{
2007. 05. 22, kedd keltezéssel 03.35-kor Don Don ezt írta:
Hi all, am trying to run a regular expression to a list of user entered data
on some forms.
I've creating what i think is a matching pattern for each category as shown
below:
function validateEntry($regularExpression,
On 5/22/07, Zoltán Németh [EMAIL PROTECTED] wrote:
2007. 05. 22, kedd keltezéssel 03.35-kor Don Don ezt írta:
Hi all, am trying to run a regular expression to a list of user entered data
on some forms.
I've creating what i think is a matching pattern for each category as shown
below:
Don Don wrote:
Hi all, am trying to run a regular expression to a list of user entered data on
some forms.
I've creating what i think is a matching pattern for each category as shown
below:
function validateEntry($regularExpression, $fieldValue)
{
if(preg_match($regularExpression,
Don Don wrote:
Hi all, am trying to run a regular expression to a list of user entered data
on some forms.
I've creating what i think is a matching pattern for each category as shown
below:
function validateEntry($regularExpression, $fieldValue)
{
if(preg_match($regularExpression,
At 11:42 PM +0200 11/29/06, Dotan Cohen wrote:
On 20/11/06, Paul Novitski [EMAIL PROTECTED] wrote:
-snip-
Paul, I just got around to reading this thread. The post of yours that
I quote above has got to be one of the best posts that I've read in
the 5 years that I've been on and off the php list.
On 20/11/06, Paul Novitski [EMAIL PROTECTED] wrote:
Børge,
Here's how I would think this one through:
First, I'm having to make several guesses at the nature of your text content:
- You use the single word topic but I'll assume
this can be multiple words and spaces.
- Your source string
Ok I seem to need to learn regular expressions more than anything.
this is what im working on:
[desc] = c FF topic c 99 rest of the text ,
$string = preg_replace(/c\s\w[0-9A-F]+/,,$string);
prints out: topic rest of the text ( with double spaces :(, I thought
\s would fix
Darrell Brogdon wrote:
Can you elaborate a little? Do you mean that you want certain letters
to have a numeric representation?
-D
no, what I was meaning was in relationship to each other, whether they
are the same letter or not.
--
PHP General Mailing List (http://www.php.net/)
To
Is there a way to make a regular expression to match on a particular way
the letters are arranged? For instance, if you had a word:
THAT
It could match on any word in the dictionary that had the form:
1231
preg_,match('/^(\w){1}\w\w\1$/');
would match the above on a single line for
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Okay, what I am referring to is cryptograms, where one letter is
substituted for another. I would like to be able to list all the words
in a dictionary that have that arrangement of their letters. Later on,
I would like to be able to do an entire
John Meyer wrote:
Is there a way to make a regular expression to match on a particular way
the letters are arranged? For instance, if you had a word:
THAT
It could match on any word in the dictionary that had the form:
1231
I think something like this might be possible using
Is there a way to make a regular expression to match on a particular way
the letters are arranged? For instance, if you had a word:
THAT
It could match on any word in the dictionary that had the form:
1231
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit:
Can you elaborate a little? Do you mean that you want certain
letters to have a numeric representation?
-D
On Nov 14, 2006, at 6:57 PM, John Meyer wrote:
Is there a way to make a regular expression to match on a
particular way
the letters are arranged? For instance, if you had a word:
On Mon, October 16, 2006 4:01 pm, Curt Zirzow wrote:
That makes me wonder.. according to the docs U inverts greediness, if
you have...
/foo.*?bar/U
does that make .*? a greedy .*
I believe I stubbed my toe on that fact once, yes...
I always manage to mess up the greedy/ungreedy stuff, and
On Sat, October 14, 2006 4:19 pm, Morten Twellmann wrote:
I'm trying to understand these regular expressions, but I can't make
them
work...
All I want to do, is to find the first occurrence of some text inside
the
HTML tags h1 and /h1.
Example string: pOctober 14, 2006/ph1Welcome to my
*edit* sorry I didn't think and just hit reply on this instead of reply
all... sorry Richard */edit*
[snip]
.*? is kinda silly -- .* mean 0 or more characters, and ? means maybe
but putting them together has no added value, so lose the ?
[/snip]
I could be wrong (and under the considerable
On 10/16/06, Chrome [EMAIL PROTECTED] wrote:
*edit* sorry I didn't think and just hit reply on this instead of reply
all... sorry Richard */edit*
[snip]
.*? is kinda silly -- .* mean 0 or more characters, and ? means maybe
but putting them together has no added value, so lose the ?
[/snip]
I
On Mon, October 16, 2006 2:54 pm, Chrome wrote:
*edit* sorry I didn't think and just hit reply on this instead of
reply
all... sorry Richard */edit*
[snip]
.*? is kinda silly -- .* mean 0 or more characters, and ? means
maybe
but putting them together has no added value, so lose the ?
[snip]
? means maybe in some other place in PCRE. Or maybe that's POSIX.
Never have figured that one out.
[/snip]
? directly after an expression is equivalent to {0,1} (maybe) but after a
quantifier (*, +, {}) means ungreedy
I'm sure I'll be corrected if I'm wrong :)
Dan
--
-general@lists.php.net
Sent: Monday, October 16, 2006 7:42 PM
Subject: Re: [PHP] Regular expressions
On Sat, October 14, 2006 4:19 pm, Morten Twellmann wrote:
I'm trying to understand these regular expressions, but I can't make
them
work...
All I want to do, is to find the first
On 10/16/06, Richard Lynch [EMAIL PROTECTED] wrote:
On Mon, October 16, 2006 2:54 pm, Chrome wrote:
*edit* sorry I didn't think and just hit reply on this instead of
reply
all... sorry Richard */edit*
[snip]
.*? is kinda silly -- .* mean 0 or more characters, and ? means
maybe
but
On 10/16/06, Chrome [EMAIL PROTECTED] wrote:
[snip]
? means maybe in some other place in PCRE. Or maybe that's POSIX.
Never have figured that one out.
[/snip]
? directly after an expression is equivalent to {0,1} (maybe) but after a
quantifier (*, +, {}) means ungreedy
I kind of talked about
On 10/16/06, Chrome [EMAIL PROTECTED] wrote:
[snip]
? means maybe in some other place in PCRE. Or maybe that's POSIX.
Never have figured that one out.
[/snip]
? directly after an expression is equivalent to {0,1} (maybe) but
after a quantifier (*, +, {}) means ungreedy
I kind of talked
I'm trying to understand these regular expressions, but I can't make them
work...
All I want to do, is to find the first occurrence of some text inside the
HTML tags h1 and /h1.
Example string: pOctober 14, 2006/ph1Welcome to my
homepage/h1pWe're happy to announce.../p
must return:
Welcome to
On Sat, 14 Oct 2006 23:19:13 +0200, Morten Twellmann [EMAIL PROTECTED]
wrote:
I'm trying to understand these regular expressions, but I can't make them
work...
All I want to do, is to find the first occurrence of some text inside the
HTML tags h1 and /h1.
Example string: pOctober 14,
On 4/12/06, Chris Westbrook [EMAIL PROTECTED] wrote:
I have a problem. I'm trying to get a Google search results page via snoopy
and then display the links of the results it returns in an application. I
know about the fetchlinks function in snoopy, but I'm having trouble getting
the text
I have a problem. I'm trying to get a Google search results page via snoopy
and then display the links of the results it returns in an application. I
know about the fetchlinks function in snoopy, but I'm having trouble getting
the text between the a and /a tags. Yeah, I know, I should use
Hi all,
I have one small problem I don't understand the preg_replace() method.
I understand the gist of what it does but I still don't fully know
what it does. I have read the entry in the php manual about this and
I am still confused about it. I've never been any good with regular
expressions.
[snip]
I have one small problem I don't understand the preg_replace() method.
I understand the gist of what it does but I still don't fully know
what it does. I have read the entry in the php manual about this and
I am still confused about it. I've never been any good with regular
expressions.
Hi there!
I'm no good at reg exp... Yes, I confess..
Here's my code
?php
$lines = file('export/nhExportVarupiraten.txt');
// Loop through our array, show HTML source as HTML source; and line numbers
too.
foreach ($lines as $line_num = $line) {
echo Line #b{$line_num}/b : .
Gustav Wiberg wrote:
?php
$lines = file('export/nhExportVarupiraten.txt');
// Loop through our array, show HTML source as HTML source; and line
numbers too.
foreach ($lines as $line_num = $line) {
echo Line #b{$line_num}/b : . htmlspecialchars($line) . br /\n;
if ($line_num 0 ) {
- Original Message -
From: Jasper Bryant-Greene [EMAIL PROTECTED]
To: PHP General php-general@lists.php.net
Sent: Sunday, October 09, 2005 8:06 PM
Subject: Re: [PHP] Regular expressions
Gustav Wiberg wrote:
?php
$lines = file('export/nhExportVarupiraten.txt');
// Loop through our
The best I found is:
O'Reilly book - Mastering Regular Expressions
On 8/3/05, -k. [EMAIL PROTECTED] wrote:
Has anyone here tried to learn Regular expressions with RegexBuddy?
http://www.regular-expressions.info/regexbuddy.html
It looks pretty cool, and even has some PHP specific
Hi,
I've want to dig a bit deeper into regular expressions for php.
I wonder if anyone can help me choosing between 2 books I'm considering buying:
1. Open Source Regular Expression Recipes - Nathan A Good
2. Mastering Regular Expressions - Jeffrey Freidl
If your using/reading one of these
Stefan Lemmen wrote:
Hi,
I've want to dig a bit deeper into regular expressions for php.
I wonder if anyone can help me choosing between 2 books I'm considering buying:
1. Open Source Regular Expression Recipes - Nathan A Good
2. Mastering Regular Expressions - Jeffrey Freidl
If your
On Wed, 03 Aug 2005 12:10:40 -0500, Edward Vermillion wrote:
Stefan Lemmen wrote:
Hi,
I've want to dig a bit deeper into regular expressions for php.
I wonder if anyone can help me choosing between 2 books I'm considering
buying:
1. Open Source Regular Expression Recipes - Nathan A
Has anyone here tried to learn Regular expressions with RegexBuddy?
http://www.regular-expressions.info/regexbuddy.html
It looks pretty cool, and even has some PHP specific stuff, but you have to pay
to play.
-k.
__
Do You Yahoo!?
Tired of
For example I want to math this stream:
123 mm 334
What is the pattern that math with this stream?
Thanks
On 4/29/05, Malcolm Mill [EMAIL PROTECTED] wrote:
What is it you want to do?
On 4/29/05, Khorosh Irani [EMAIL PROTECTED] wrote:
Hello
I have a question:
What is in the role of
Khorosh Irani wrote:
For example I want to math this stream:
123 mm 334
What is the pattern that math with this stream?
Thanks
123[[:space:]]+mm[[:space:]]+334
-Rasmus
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
* Khorosh Irani [EMAIL PROTECTED]:
For example I want to math this stream:
123 mm 334
What is the pattern that math with this stream?
Depends on what regexp function you use, what exactly you want to match,
and whether or not you want to know, after you match, any of the
segments. Rasmus has
Hello
I have a question:
What is in the role of space in the regular expressions (POSIX)?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
I've been messing about with this for a while to no avail.. so help
would be appreciates
I'm new to regular expressions and tried this with preg_replace, now I'm
using eregi_replace !
here's the text
$txt = 'span style=font-size: 10pt; font-family: Times New
Roman;Itbr /
blahh blahhh blahhh
pete M wrote:
I've been messing about with this for a while to no avail.. so help
would be appreciates
I'm new to regular expressions and tried this with preg_replace, now I'm
using eregi_replace !
here's the text
$txt = 'span style=font-size: 10pt; font-family: Times New
Roman;Itbr /
blahh
The pattern
$pattern = 'font\-size:.*?\;';
throwns the error
eregi_replace(): REG_BADRPT
Erwin Kerk wrote:
pete M wrote:
I've been messing about with this for a while to no avail.. so help
would be appreciates
I'm new to regular expressions and tried this with preg_replace, now
I'm using
pete M wrote:
The pattern
$pattern = 'font\-size:.*?\;';
throwns the error
eregi_replace(): REG_BADRPT
Well, this should work (tested and all )
$pattern=|font\-size:.*?;|si;
$txt = preg_replace( $pattern, , $txt );
Erwin
--
Thankyou
Diolch
danka
There seems to be a big difference between eregi_replace() and preg_replace
Am reding teh Sams - Regular Expressions in 10 mins bu the syntax seems
ot be different. !!
regards
pete
Erwin Kerk wrote:
pete M wrote:
The pattern
$pattern = 'font\-size:.*?\;';
throwns the error
Php docs are quite messy about what works with what function...
This is my problem; I want to strip out spaces from my tags:
$word = [ / quote ];
$word = eregi_replace([[[:blank:]]*quote[[:blank:]]*], [quote], $word);
$word = eregi_replace([[[:blank:]]*\/[[:blank:]]*quote[[:blank:]]*],
[/quote],
On Tuesday 12 April 2005 18:30, jem777 wrote:
Php docs are quite messy about what works with what function...
This is my problem; I want to strip out spaces from my tags:
$word = [ / quote ];
$word = eregi_replace([[[:blank:]]*quote[[:blank:]]*], [quote],
$word); $word =
ok for this 2:
$body = preg_replace('|\[\s*quote\s*\]|', '[quote]', $body);
$body = preg_replace('|\[\s*/\s*quote\s*\]|', '[/quote]', $body);
but have these next instructions the same result?
$body = eregi_replace(\[ *quote *\], [quote], $body);
$body = eregi_replace(\[ */ *quote *\], [/quote],
Windows 2000 Server
IIS 5/Apache 1.3.33
MySQL 4.1.1
Smarty 2.6.9
PHP 5.0.3
Hi all,
I am looking for help handling a form input to SQL. I believe the solution has
to do with regular expressions.
My big problem is that when a user submits data such as:
Joe's Crabshack
The ' apostrophe or can
[EMAIL PROTECTED]
mailto:[EMAIL PROTECTED]
on Friday, April 08, 2005 3:43 PM said:
The ' apostrophe or can cause an early truncation of the data. My
code thinks that the closing identifier is after the word Joe and the
rest of the input is lost. Further, if the data does get by and it
Ok that would solve my SQL statements from breaking but how about in the
submitted form data at submit time?
John
[EMAIL PROTECTED]
mailto:[EMAIL PROTECTED]
on Friday, April 08, 2005 3:43 PM said:
The ' apostrophe or can cause an early truncation of the data. My
code thinks that the
[EMAIL PROTECTED]
mailto:[EMAIL PROTECTED]
on Friday, April 08, 2005 4:08 PM said:
Ok that would solve my SQL statements from breaking but how about in
the submitted form data at submit time?
Do you mean you're having this problem?
input type=text name=.. value=She said Hi! /
?
If so,
[EMAIL PROTECTED] wrote:
Windows 2000 Server
IIS 5/Apache 1.3.33
MySQL 4.1.1
Smarty 2.6.9
PHP 5.0.3
Hi all,
I am looking for help handling a form input to SQL. I believe the solution has to do with regular expressions.
My big problem is that when a user submits data such as:
Joe's Crabshack
The
[EMAIL PROTECTED] wrote:
snip
Joe's Crabshack
The ' apostrophe or can cause an early truncation of the data. My code thinks
that the closing identifier is after the word Joe and the rest of the input is lost.
Further, if the data does get by and it could possibly break a SQL statement.
Am I
On Fri, April 8, 2005 3:43 pm, [EMAIL PROTECTED] said:
I am looking for help handling a form input to SQL. I believe the solution
has to do with regular expressions.
My big problem is that when a user submits data such as:
Joe's Crabshack
The ' apostrophe or can cause an early truncation
Hi!
I had a script for parsing text into html, similar to phpBB. Everything
has been working fine until now. Some of my 'pseudotags' like [b] are
still recognized (parsed into b) but some more advanced pattern
matching is not. I haven't changed the code, but the php-version on the
server has
On Thu, 27 Jan 2005 11:36:39 -0800, Rick Fletcher [EMAIL PROTECTED] wrote:
/^(1?[1-9]|[12]0)$/ works too. The first part covers 1-9, 11-19; the
second part gets you 10 and 20.
Plus, it's ever so slightly shorter! And isnt' that what's most
important? :P
absolutely, and you managed it
Hello,
I need to verify if $x is between 1 and 20 and i need to do that with
regular expressions ?
anyone can help me outta there ?
thanks a lot
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Zouari Fourat wrote:
Hello,
I need to verify if $x is between 1 and 20 and i need to do that with
regular expressions ?
anyone can help me outta there ?
thanks a lot
http://www.php.net/operators.comparison
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit:
[snip]
I need to verify if $x is between 1 and 20 and i need to do that with
regular expressions ?
anyone can help me outta there ?
[/snip]
Why regex?
if((1 $x) ($x 20)){
it's true
}
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit:
Hello Zouari,
Thursday, January 27, 2005, 7:33:04 AM, you wrote:
Z I need to verify if $x is between 1 and 20 and i need to do that
Z with regular expressions ?
If you *need* to do it with regexp, try this:
if (preg_match(/[2-19]/,$x))
echo It is!;
If 1 and 20 are
Zouari Fourat wrote:
here's the problem :
my user MUST input only digits between 1 and 20
doing a is_numeric and some comparaison can be bypassed by inputing :
.5
or
0.5
or
5.1
or
0.3
or
.01
...
...
so i thought that the smartest way is to use regex
if( $i = 1 $i = 20 $i == (int)$i) ...
--
PHP
if (preg_match(/[2-19]/,$x))
echo It is!;
doesnt work !
this is working fine :
if (eregi(^-?([1-3])+$,$x)
echo x is 1 or 2 or 3;
On Thu, 27 Jan 2005 08:42:19 -0700, Leif Gregory [EMAIL PROTECTED] wrote:
Hello Zouari,
Thursday, January 27, 2005, 7:33:04 AM, you wrote:
Z I need to
this is working fine :
if (eregi(^-?([1-3])+$,$x)
echo x is 1 or 2 or 3;
i forgot to say that doesnt work with 1-20 :(
how to do it ?
On Thu, 27 Jan 2005 16:53:55 +0100, Zouari Fourat [EMAIL PROTECTED] wrote:
if (preg_match(/[2-19]/,$x))
echo It is!;
doesnt work !
this is working
to Marek Kilimajer :
$i='5.';
if (($i=1) ($i=20) ($i==(int)$i))
echo 'yes';
// yes
:'(
On Thu, 27 Jan 2005 16:52:20 +0100, Marek Kilimajer [EMAIL PROTECTED] wrote:
Zouari Fourat wrote:
here's the problem :
my user MUST input only digits between 1 and 20
1 - 100 of 257 matches
Mail list logo