Stuart Dallas stu...@3ft9.com wrote:
On 18 May 2012, at 14:50, Jim Giner wrote:
Daft is a little harsh. :) 00:40 is just not a time value that is
generally accepted.
It may appear harsh, but as far as I'm concerned it is daft to make
assumptions like that. You've essentially disallowed
Jim Lucas li...@cmsws.com wrote in message
news:4fb5decc.20...@cmsws.com...
On 5/17/2012 9:52 PM, Jim Lucas wrote:
How about this instead?
pre?php
$times = array(
'100', # valid
'1100', # valid
'1300', # invalid
'01:00', # valid
'12:59', # valid
'00:01', # valid
'00:25pm', #
Jim Lucas li...@cmsws.com wrote in message
news:4fb5decc.20...@cmsws.com...
On 5/17/2012 9:52 PM, Jim Lucas wrote:
How about this instead?
pre?php
$times = array(
'100', # valid
'1100', # valid
'1300', # invalid
'01:00', # valid
'12:59', # valid
'00:01', # valid
'00:25pm', #
On 18 May 2012, at 14:32, Jim Giner wrote:
OK - I don't yet understand how this works, but it seems to work for almost
all cases. The one erroneous result I get is from a value of 0040 (which I
convert to 00:40 before hitting the regexp). It comes thru as Ok. If you
have a fix for that
On Fri, May 18, 2012 at 7:34 PM, Stuart Dallas stu...@3ft9.com wrote:
Based on your requirements, 00:40 is completely valid. Why do you think it
should be invalid?
00:40 is not a valid 12-hour format.
BTW I just found another non-regex approach. Its even faster.
function
Stuart Dallas stu...@3ft9.com wrote in message
news:cc22e241-c1df-48e9-bf06-8a638a356...@3ft9.com...
On 18 May 2012, at 14:32, Jim Giner wrote:
OK - I don't yet understand how this works, but it seems to work for
almost
all cases. The one erroneous result I get is from a value of 0040
On 18 May 2012, at 14:41, Jim Giner wrote:
Stuart Dallas stu...@3ft9.com wrote in message
news:cc22e241-c1df-48e9-bf06-8a638a356...@3ft9.com...
On 18 May 2012, at 14:32, Jim Giner wrote:
OK - I don't yet understand how this works, but it seems to work for
almost
all cases. The one
times so 40 minutes after minute would be a) not practical and b) still not
I meant to say 40 minutes after MIDNIGHT.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Stuart Dallas stu...@3ft9.com wrote in message
news:79538829-bfc4-43a4-a413-72247b145...@3ft9.com...
On 18 May 2012, at 14:41, Jim Giner wrote:
Stuart Dallas stu...@3ft9.com wrote in message
news:cc22e241-c1df-48e9-bf06-8a638a356...@3ft9.com...
On 18 May 2012, at 14:32, Jim Giner wrote:
OK
On 18 May 2012, at 14:50, Jim Giner wrote:
Daft is a little harsh. :) 00:40 is just not a time value that is
generally accepted.
It may appear harsh, but as far as I'm concerned it is daft to make assumptions
like that. You've essentially disallowed 12:nn am, but allowed 1:nn am, 2:nn
On 2012-05-17 22:37, Jim Giner wrote:
Trying to validate an input of a time value in the format hh:mm, wherein
I'll accept anything like the following:
hmm
hhmm
h:mm
hh:mm
in a 12 hour format. My problem is my test is ok'ing an input of 1300.
Here is my test:
if (0 ==
Stuart Dallas stu...@3ft9.com wrote in message
news:aba011df-8cdf-4492-be4d-51c2b54c4...@3ft9.com...
On 18 May 2012, at 14:50, Jim Giner wrote:
Daft is a little harsh. :) 00:40 is just not a time value that is
generally accepted.
It may appear harsh, but as far as I'm concerned it is daft
On Thu, May 17, 2012 at 3:37 PM, Jim Giner jim.gi...@albanyhandball.com wrote:
ok - finally had to come up with my own regexp - and am failing.
Trying to validate an input of a time value in the format hh:mm, wherein
I'll accept anything like the following:
hmm
hhmm
h:mm
hh:mm
in a 12
ok - finally had to come up with my own regexp - and am failing.
Trying to validate an input of a time value in the format hh:mm, wherein
I'll accept anything like the following:
hmm
hhmm
h:mm
hh:mm
in a 12 hour format. My problem is my test is ok'ing an input of 1300.
Here is my test:
if
On Fri, May 18, 2012 at 2:37 AM, Jim Giner jim.gi...@albanyhandball.comwrote:
ok - finally had to come up with my own regexp - and am failing.
Trying to validate an input of a time value in the format hh:mm, wherein
I'll accept anything like the following:
hmm
hhmm
h:mm
hh:mm
in a 12
Try this:
/(0?[1-9]|[12][0-9]):?[0-5][0-9]/
FYI: ? is equal to {0,1}, and [1-9] to [123456789] (and therefore [1-2]
to [12]).
Am 17.05.2012 22:37, schrieb Jim Giner:
ok - finally had to come up with my own regexp - and am failing.
Trying to validate an input of a time value in the format
Yared Hufkens y4...@yahoo.de wrote in message
news:4fb5667d.7020...@yahoo.de...
Try this:
/(0?[1-9]|[12][0-9]):?[0-5][0-9]/
FYI: ? is equal to {0,1}, and [1-9] to [123456789] (and therefore [1-2]
to [12]).
Am 17.05.2012 22:37, schrieb Jim Giner:
ok - finally had to come up with my own
FWIW - I couldn't find much in the way of tutorials on the meanings of the
various chars in regexp's.
this helps alot:
http://www.gskinner.com/RegExr/
you can paste your pattern (needle) in the top input, and hover over each char
to see what it means in grep land.
Paste your haystack in
Thank you !
Govinda govinda.webdnat...@gmail.com wrote in message
news:3e5dce87-29c1-4679-ad3a-53326435f...@gmail.com...
FWIW - I couldn't find much in the way of tutorials on the meanings of the
various chars in regexp's.
this helps alot:
http://www.gskinner.com/RegExr/
you can paste your
On 5/17/2012 1:57 PM, shiplu wrote:
On Fri, May 18, 2012 at 2:37 AM, Jim Ginerjim.gi...@albanyhandball.comwrote:
ok - finally had to come up with my own regexp - and am failing.
Trying to validate an input of a time value in the format hh:mm, wherein
I'll accept anything like the following:
Jim Lucas li...@cmsws.com wrote in message
news:4fb5b89e.8050...@cmsws.com...
On 5/17/2012 1:57 PM, shiplu wrote:
On Fri, May 18, 2012 at 2:37 AM, Jim
Ginerjim.gi...@albanyhandball.comwrote:
ok - finally had to come up with my own regexp - and am failing.
Trying to validate an input of a
On 5/17/2012 8:07 PM, Jim Giner wrote:
Jim Lucasli...@cmsws.com wrote in message
news:4fb5b89e.8050...@cmsws.com...
On 5/17/2012 1:57 PM, shiplu wrote:
On Fri, May 18, 2012 at 2:37 AM, Jim
Ginerjim.gi...@albanyhandball.comwrote:
ok - finally had to come up with my own regexp - and am
On 5/17/2012 9:52 PM, Jim Lucas wrote:
How about this instead?
pre?php
$times = array(
'100', # valid
'1100', # valid
'1300', # invalid
'01:00', # valid
'12:59', # valid
'00:01', # valid
'00:25pm', # invalid
'', # valid
'a00', # invalid
'00', # invalid
);
foreach ( $times AS $time )
echo
Jim L. I did't actually consider that wide range of time values. Here
is an update. Still this can be written without help of regex. I must
add one more thing that a '00:01' is invalid in 12 hour format. OP
wants it to be 12-hour format.
function valid_time($time){
$m = substr($time,
-Original Message-
From: Andre Polykanine [mailto:an...@oire.org]
Sent: 14 October 2010 21:42
Hi everyone,
I hope you're doing well (haven't written here for a long time :-)).
The question is as follows: I have a regexp that would do the
following. If the string begins with Re:,
On 15 October 2010 10:16, Ford, Mike m.f...@leedsmet.ac.uk wrote:
-Original Message-
From: Andre Polykanine [mailto:an...@oire.org]
Sent: 14 October 2010 21:42
Hi everyone,
I hope you're doing well (haven't written here for a long time :-)).
The question is as follows: I have a
On Fri, Oct 15, 2010 at 5:52 AM, Richard Quadling rquadl...@gmail.com wrote:
On 15 October 2010 10:16, Ford, Mike m.f...@leedsmet.ac.uk wrote:
-Original Message-
From: Andre Polykanine [mailto:an...@oire.org]
Sent: 14 October 2010 21:42
Hi everyone,
I hope you're doing well (haven't
On 15 October 2010 15:45, Andrew Ballard aball...@gmail.com wrote:
On Fri, Oct 15, 2010 at 5:52 AM, Richard Quadling rquadl...@gmail.com wrote:
On 15 October 2010 10:16, Ford, Mike m.f...@leedsmet.ac.uk wrote:
-Original Message-
From: Andre Polykanine [mailto:an...@oire.org]
Sent: 14
On Fri, Oct 15, 2010 at 11:07 AM, Richard Quadling rquadl...@gmail.com wrote:
On 15 October 2010 15:45, Andrew Ballard aball...@gmail.com wrote:
On Fri, Oct 15, 2010 at 5:52 AM, Richard Quadling rquadl...@gmail.com
wrote:
On 15 October 2010 10:16, Ford, Mike m.f...@leedsmet.ac.uk wrote:
Hi everyone,
I hope you're doing well (haven't written here for a long time :-)).
The question is as follows: I have a regexp that would do the
following. If the string begins with Re:, it will change the
beginning to Re[2]:; if it doesn't, then it would add Re: at the
beginning. But (attention,
On Thu, Oct 14, 2010 at 1:42 PM, Andre Polykanine an...@oire.org wrote:
But (attention, here it is!) if the string starts with
something like Re[4]:, it should replace it by Re[5]:.
Regular expressions do not support any mathematical operations. Instead, you
need to use preg_match() to
On 14 October 2010 21:42, Andre Polykanine an...@oire.org wrote:
Hi everyone,
I hope you're doing well (haven't written here for a long time :-)).
The question is as follows: I have a regexp that would do the
following. If the string begins with Re:, it will change the
beginning to Re[2]:; if
Hi,
I'm trying to insert a serialized data into mysql, but I does
mysql_real_escape_string() before inserting it.
INSERT IGNORE INTO `table` (`value`) VALUES
('a:3:{s:12:F1;s:6:nombre;s:11:F2;s:5:F3;s:16:F4;s:10:F5;}');
it result in
INSERT IGNORE INTO `table` (`value`) VALUES
From: spudm...@hotmail.com
To: php-general@lists.php.net
Date: Fri, 14 May 2010 22:01:09 +0200
Subject: RE: [PHP] regexp questions
Hi,
I'm trying to insert a serialized data into mysql, but I does
mysql_real_escape_string() before inserting it.
INSERT IGNORE
On Fri, 2010-05-14 at 22:01 +0200, Spud. Ivan. wrote:
Hi,
I'm trying to insert a serialized data into mysql, but I does
mysql_real_escape_string() before inserting it.
INSERT IGNORE INTO `table` (`value`) VALUES
-Original Message-
From: Spud. Ivan. [mailto:spudm...@hotmail.com]
Sent: 11 May 2010 15:56
To: php-general@lists.php.net
Subject: RE: [PHP] regexp questions
hehe, but I can't find anything related to regexp. I've found
something at http://php.net/preg_match
Changelog
Try
Subject: RE: [PHP] regexp questions
Date: Wed, 12 May 2010 11:11:07 +0100
From: m.f...@leedsmet.ac.uk
To: spudm...@hotmail.com; php-general@lists.php.net
-Original Message-
From: Spud. Ivan. [mailto:spudm...@hotmail.com]
Sent: 11 May 2010 15:56
To: php-general
Date: Tue, 11 May 2010 15:38:41 -0700
From: li...@cmsws.com
To: spudm...@hotmail.com
CC: php-general@lists.php.net
Subject: Re: [PHP] regexp questions
Spud. Ivan. wrote:
I think we've not so much only with the regex, but maybe you can tell me
somethin helpful ;)
/Word1
On Wed, 2010-05-12 at 18:13 +0200, Spud. Ivan. wrote:
Date: Tue, 11 May 2010 15:38:41 -0700
From: li...@cmsws.com
To: spudm...@hotmail.com
CC: php-general@lists.php.net
Subject: Re: [PHP] regexp questions
Spud. Ivan. wrote:
I think we've not so much only
Subject: RE: [PHP] regexp questions
From: a...@ashleysheridan.co.uk
To: spudm...@hotmail.com
CC: php-general@lists.php.net
Date: Wed, 12 May 2010 17:11:11 +0100
On Wed, 2010-05-12 at 18:13 +0200, Spud. Ivan. wrote:
Date: Tue, 11 May 2010 15:38:41 -0700
From: li...@cmsws.com
On Wed, 2010-05-12 at 18:23 +0200, Spud. Ivan. wrote:
Subject: RE: [PHP] regexp questions
From: a...@ashleysheridan.co.uk
To: spudm...@hotmail.com
CC: php-general@lists.php.net
Date: Wed, 12 May 2010 17:11:11 +0100
On Wed, 2010-05-12 at 18:13 +0200, Spud. Ivan. wrote
On May 12, 2010, at 11:20 AM, Ashley Sheridan wrote:
On Wed, 2010-05-12 at 18:23 +0200, Spud. Ivan. wrote:
Subject: RE: [PHP] regexp questions
From: a...@ashleysheridan.co.uk
To: spudm...@hotmail.com
CC: php-general@lists.php.net
Date: Wed, 12 May 2010 17:11:11 +0100
On Wed, 2010-05-12
The flags parameter was added
But it doesn't explain why my regexps work fine within php 5.1 but 5.3
Ivan.
-Original Message-
From: Spud. Ivan. [mailto:spudm...@hotmail.com]
Sent: 11 May 2010 01:25
To: php-general@lists.php.net
Subject: RE: [PHP] regexp
On 05/11/2010 09:56 AM, Spud. Ivan. wrote:
But it doesn't explain why my regexps work fine within php 5.1 but 5.3
Ivan.
Post a regex and what you think it should match but doesn't.
--
Thanks!
-Shawn
http://www.spidean.com
--
PHP General Mailing List (http://www.php.net/)
To
I think we've not so much only with the regex, but maybe you can tell me
somethin helpful ;)
/Word1:\/a\/h4\(a
href=\http:\/\/www.thiswebsite.com\/some-script.php\fir.*?st
word.*?(.*)Word2:\/a\/h4ul(.*)Second
word:\/a\/h4ul(.*)Word3:\/a\/h4ul(.*)rd word/is
Thanks.
I.Lopez.
On 05/11/2010
On Tue, 2010-05-11 at 22:45 +0200, Spud. Ivan. wrote:
I think we've not so much only with the regex, but maybe you can tell me
somethin helpful ;)
/Word1:\/a\/h4\(a
href=\http:\/\/www.thiswebsite.com\/some-script.php\fir.*?st
word.*?(.*)Word2:\/a\/h4ul(.*)Second
From: a...@ashleysheridan.co.uk
To: spudm...@hotmail.com
CC: php-general@lists.php.net
Date: Tue, 11 May 2010 21:43:54 +0100
Subject: RE: [PHP] regexp questions
On Tue, 2010-05-11 at 22:45 +0200, Spud. Ivan. wrote:
I think we've not so much only with the regex, but maybe you
On Tue, 2010-05-11 at 23:48 +0200, Spud. Ivan. wrote:
From: a...@ashleysheridan.co.uk
To: spudm...@hotmail.com
CC: php-general@lists.php.net
Date: Tue, 11 May 2010 21:43:54 +0100
Subject: RE: [PHP] regexp questions
On Tue, 2010-05-11 at 22:45 +0200, Spud. Ivan. wrote
Spud. Ivan. wrote:
I think we've not so much only with the regex, but maybe you can tell me
somethin helpful ;)
/Word1:\/a\/h4\(a
href=\http:\/\/www.thiswebsite.com\/some-script.php\fir.*?st
word.*?(.*)Word2:\/a\/h4ul(.*)Second
word:\/a\/h4ul(.*)Word3:\/a\/h4ul(.*)rd word/is
Hi,
I've recently changed from php 5.1 to 5.3.2 and I'm havong problems with
preg_match, because the same regular expressions used in php 5.1 are not
matching anything in 5.3.2.
There are any significant changes that I should know?
I've been searching but I haven't found anything.
Thanks.
For example, the following regex doesn't work.
return (bool) preg_match('/^[\pL\pN\pZ\p{Pc}\p{Pd}\p{Po}]++$/uD',
(string) $str);
Shiplu Mokadd.im
My talks, http://talk.cmyweb.net
Follow me, http://twitter.com/shiplu
SUST Programmers, http://groups.google.com/group/p2psust
Innovation
Is there any place where to read the changelog or something?
Thanks.
For example, the following regex doesn't work.
return (bool) preg_match('/^[\pL\pN\pZ\p{Pc}\p{Pd}\p{Po}]++$/uD',
(string) $str);
Shiplu Mokadd.im
I have been plauged for a few days by this, can anyone see a problem with
this function??
function printByType($string, $mode)
{
(string) $string;
$lengths = array(
'VARCHAR' = 10
, 'TINYINT' = 1
, 'TEXT' = 10
, 'DATE' = 7
, 'SMALLINT' = 1
, 'MEDIUMINT' = 2
,
There can be a problem. But do you see a problem?? if yes. what is it?
May be we can find the solution.
--
Shiplu Mokaddim
My talks, http://talk.cmyweb.net
Follow me, http://twitter.com/shiplu
SUST Programmers, http://groups.google.com/group/p2psust
Innovation distinguishes bet ... ... (ask
On a quick glance I don't think you are doing the casting correctly. For
example, you have stuff like:
(string) $string;
and
(string) $key;
(int) $val;
and
(int) $length_value = $match[1];
and the casted value is not being saved anywhere.
I believe it should be something like $string =
I think part of the problem may lie in the use of variables in regular
expressions. I am trying to use the perl-style preg_match(), but the regular
expression values that it checks on each iteration of the foreach loop
checks for a different value (hence, the use of a variable).
On Sat, Jan 2,
Hi,
I have these lines to get parameters' name to $regs, but I always get the
first one twice.
What do I do wrong?
$sql = 'select * from hotsys where ALREND=:alrend and SYSKOD=:syskod';
eregi('(:[a-z,A-Z,0-9]+)', $sql, $regs);
Thanks,
SanTa
--
PHP General Mailing List
eregi();
That would be your first mistake. The preg_* functions are better.
--
Richard Heyes
http://www.phpguru.org
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
@lists.php.net
Subject: Re: [PHP] RegExp
On Thu, December 14, 2006 11:47 pm, WeberSites LTD wrote:
I'm trying to limit the text someone can submit in a text area with :
Code:
if(!preg_match(/^[à-úA-Za-z0-9_():,@\/\.\s\-\ ]*$/i,$FieldValue)) {
}
It works well but I'm having problems
WeberSites LTD wrote:
I'm trying to limit the text someone can submit in a text area with :
Code:
if(!preg_match(/^[א-תA-Za-z0-9_():,@\/\.\s\-\ ]*$/i,$FieldValue)) {
^^ ^-- no need for the space
given you already have '\s'
On Thu, December 14, 2006 11:47 pm, WeberSites LTD wrote:
I'm trying to limit the text someone can submit in a text area with :
Code:
if(!preg_match(/^[à-úA-Za-z0-9_():,@\/\.\s\-\ ]*$/i,$FieldValue)) {
}
It works well but I'm having problems with the (double quote).
If there is a
I'm trying to limit the text someone can submit in a text area with :
Code:
if(!preg_match(/^[א-תA-Za-z0-9_():,@\/\.\s\-\ ]*$/i,$FieldValue)) {
}
It works well but I'm having problems with the (double quote).
If there is a double quote () it fails.
On Fri, April 28, 2006 11:16 am, Weber Sites LTD wrote:
I'm looking for the RegExp that will split a search string into search
keywords.
while taking into account.
From what I managed to find I can get all of the words into an array
but I
would
like all of the words inside to be in the
:[EMAIL PROTECTED]
Sent: Saturday, April 29, 2006 10:29 AM
To: Weber Sites LTD
Cc: php-general@lists.php.net
Subject: Re: [PHP] RegExp for preg_split()
On Fri, April 28, 2006 11:16 am, Weber Sites LTD wrote:
I'm looking for the RegExp that will split a search string into search
keywords.
while
Hi:
A summation of entries.
http://xn--ovg.com/a/parse.php
neat!
tedd
--
http://sperling.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
LOL It's interesting that you've taked your time and build that
'summation', maybe the only thing is missing is the code itself ;)
Now, because you didn't add it, I had to check the different versions,
and I agree with John Hicks, his suggestion seems to be the best one.
tedd wrote:
A
Hi
I'm looking for the RegExp that will split a search string into search
keywords.
while taking into account.
From what I managed to find I can get all of the words into an array but I
would
like all of the words inside to be in the same array cell.
NE1?
thanks
berber
At 6:16 PM +0200 4/28/06, Weber Sites LTD wrote:
Hi
I'm looking for the RegExp that will split a search string into search
keywords.
while taking into account.
From what I managed to find I can get all of the words into an array but I
would
like all of the words inside to be in the same
At 6:16 PM +0200 4/28/06, Weber Sites LTD wrote:
Hi
I'm looking for the RegExp that will split a search string into search
keywords.
while taking into account.
From what I managed to find I can get all of the words into an array but I
would
like all of the words inside to be in the same
@lists.php.net
Subject: Re: [PHP] RegExp for preg_split()
At 6:16 PM +0200 4/28/06, Weber Sites LTD wrote:
Hi
I'm looking for the RegExp that will split a search string into search
keywords.
while taking into account.
From what I managed to find I can get all of the words into an array
but I would
Weber Sites LTD wrote:
Hi
I'm looking for the RegExp that will split a search string into search
keywords.
while taking into account.
From what I managed to find I can get all of the words into an array but I
would
like all of the words inside to be in the same array cell.
You want
I am trying to simplify an SQL query that is pretty much like below:
$sql = SELECT * FROM table WHERE keyword RLIKE '$expression1' OR
keyword RLIKE '$expression2' ;
The different terms '$expression1' and '$expression1' come from an array.
Is there any way to within one regular expression to
[snip]
I am trying to simplify an SQL query that is pretty much like below:
$sql = SELECT * FROM table WHERE keyword RLIKE '$expression1' OR
keyword RLIKE '$expression2' ;
The different terms '$expression1' and '$expression1' come from an
array.
Is there any way to within one regular
IN ( exp1, exp2) didn't seem to work for me. I've seen that used
before for including a subquery, but somehow it didn't like the comma
separated list.
I think this below is doing it for me.
$separated = implode(|, (explode( ,
(AddSlashes($_REQUEST['terms']);
Brian Anderson wrote:
IN ( exp1, exp2) didn't seem to work for me. I've seen that used
before for including a subquery, but somehow it didn't like the comma
separated list.
I think this below is doing it for me.
$separated = implode(|, (explode( ,
(AddSlashes($_REQUEST['terms']);
Hi list
I still fail to understand why regular expressions are causing me such a hard
time.
I used and tested my regexp in kregexpeditor (comes with Quanta [kdewebdev])
but when I put it in the php script it fails.
ereg('^([\w]{3,3})[\s]([\d]{2,2})[\s]([\d]{2,2})[:]([\d]{2,2})[:]([\d]{2,2})'
Andy,
Try preg_match instead of ereg.
Cheers,
David Grant
Andy Pieters wrote:
Hi list
I still fail to understand why regular expressions are causing me such a hard
time.
I used and tested my regexp in kregexpeditor (comes with Quanta [kdewebdev])
but when I put it in the php script
Andy Pieters wrote:
Hi list
I still fail to understand why regular expressions are causing me such a hard
time.
snip /
Hi!
Why don't you use 'preg_match'? And why do you use all those character
classes?
This:
code
$subject = 'Nov 22 06:51:36';
$pattern =
Andy Pieters wrote:
Hi list
I still fail to understand why regular expressions are causing me such a hard
time.
er, because they are hard? hey you failed! we have a club :-)
I used and tested my regexp in kregexpeditor (comes with Quanta [kdewebdev])
but when I put it in the php script
Thanks all for your contributions. Seems like the missing link was the
delimiter.
On Thursday 24 November 2005 18:23, Frank Armitage wrote:
And why do you use all those character
classes?
Err.. why NOT use character classes? What is easier [0-9] or \d or maybe
[a-zA-Z] or [\w], ... ?
Andy Pieters wrote:
Err.. why NOT use character classes? What is easier [0-9] or \d or maybe
[a-zA-Z] or [\w], ... ?
Well, first of all the square brackets in [\w] aren't needed, \w already
means 'any word character'.
Secondly, [a-zA-Z] is not the same as \w:
A word character is any
Eli [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED]
Eli wrote:
Try:
preg_replace('/(?=\)([^]*)(\w+)=(?!\'|\)([^\s]+)(?=\s|\)([^]*)(?=\)/U','\1\2=\3\4',$html);
Hmm.. that could be a
start.. and don't ask me how it works... :P
Well.. problem with that, is that if you got more
Eli [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED]
Eli wrote:
Try:
preg_replace('/(?=\)([^]*)(\w+)=(?!\'|\)([^\s]+)(?=\s|\)([^]*)(?=\)/U','\1\2=\3\4',$html);
Hmm.. that could be a
start.. and don't ask me how it works... :P
Well.. problem with that, is that if you got more
Yup.. that was a good point.. ;)
Take a look at this example:
?php
function tag_rep($tag)
{
return
reg_replace('/(?!\)(\S+)\s*=\s*(?![\'])([^\s\']+)(?![\'])/','\1=\2',$tag);
}
$html=p class=MsoNormal id=parfont size=3 face=\Comic Sans
MS\span lang=NL
Sorry for the spam.. here it is:
?php
function tag_rep($tag)
{
return
preg_replace('/(?!\)(\S+)\s*=\s*(?![\'])([^\s\']+)(?![\'])/','\1=\2',$tag);
}
$html=p class=MsoNormal id=parfont size=3 face=\Comic Sans
MS\span lang=NL style='font-size:12.0pt;font-family:\Comic Sans
MS\'a
Eli wrote:
BlackDex wrote:
Hello ppl,
I have a question about regex and html parsing.
I have the following code:
---
p class=MsoNormalfont size=3 face=Comic Sans MSspan lang=NL
style='font-size:12.0pt;font-family:Comic Sans
MS'nbsp;/span/font/p
you realise that that HTML ammounts the to the
Thx... it works almost :P
I Changed the code a bit so you can see the results quicker :).
It doesn't change every attribute/value. I think this has to do something
with the opening and closing of a tag .
My code:
---
?php
function tag_rep($tag)
{
return
On Thu, 10 Mar 2005 00:18:05 +0100, BlackDex [EMAIL PROTECTED] wrote:
Hello ppl,
I have a question about regex and html parsing.
I have the following code:
---
p class=MsoNormalfont size=3 face=Comic Sans MSspan lang=NL
style='font-size:12.0pt;font-family:Comic Sans MS'nbsp;/span/font/p
Jason Petersen [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
On Thu, 10 Mar 2005 00:18:05 +0100, BlackDex [EMAIL PROTECTED] wrote:
Hello ppl,
I have a question about regex and html parsing.
I have the following code:
---
p class=MsoNormalfont size=3 face=Comic Sans MSspan
Owkay.. i fixed it :).
Here is the final code.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Owkay i fixed it :D.
The regexp needed a /s (Pattern Modifier) also so that the .(DOT) also does
newlines :).
Now it is fixed...
Thank you very much Eli :)
/me is happy.
THE CODE:
---
?php
function tag_rep($tag)
{
return
Hello ppl,
I have a question about regex and html parsing.
I have the following code:
---
p class=MsoNormalfont size=3 face=Comic Sans MSspan lang=NL
style='font-size:12.0pt;font-family:Comic Sans MS'nbsp;/span/font/p
---
It laks some quotemarks.
I want to change it to:
---
p
BlackDex wrote:
Hello ppl,
I have a question about regex and html parsing.
I have the following code:
---
p class=MsoNormalfont size=3 face=Comic Sans MSspan lang=NL
style='font-size:12.0pt;font-family:Comic Sans MS'nbsp;/span/font/p
---
It laks some quotemarks.
I want to change it to:
---
p
Eli wrote:
Try:
preg_replace('/(?=\)([^]*)(\w+)=(?!\'|\)([^\s]+)(?=\s|\)([^]*)(?=\)/U','\1\2=\3\4',$html);
Hmm.. that could be a start.. and don't ask me how it works... :P
Well.. problem with that, is that if you got more than 1 un-escaped
attribute in a tag, the regex will fix only the first
The expression that I found won't work anymore is an own pseudo-lang
markup that renders into html-lists.
Expression for grabbing a list, Example:
[lista] some text [/lista]
@\[\s*(lista)\s*(sq|o|\*|#|a|i)?\s*\]([^\x00]*?)\[/[EMAIL PROTECTED]
$3 is then treated separated into html
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
Kristian Hellquist wrote:
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
Hi!
Last help about regexp solve my problem, but I have another one.
I've made some regexp but it does not work always
Let say I have some strings
1) this is some domain.com test
2) domain.com
I can make this work either for first example of fo second, but not for
both. What I want is replace of
You could maybe cheat and add an X at the beginning and end of the string
before your Regex, then you will have:
X\1 \2 \3X
and you can strip off the initial X from \1 and the trailing X from \3
There's probably some fancy Regexp way to do it though.
Uroš Gruber wrote:
Hi!
Last help about
On Thu, 06 Jan 2005 13:50:58 +0100, Uro Gruber [EMAIL PROTECTED] wrote:
1) this is some domain.com test
2) domain.com
I can make this work either for first example of fo second, but not for
both. What I want is replace of domain.com to get
this is dome domain.com domain com test so
1 - 100 of 186 matches
Mail list logo