Stuart Dallas" 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 12:nn am, but al
On Thu, May 17, 2012 at 3:37 PM, Jim Giner 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 hour format. My prob
"Stuart Dallas" 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 to make
as
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 == preg_match("/([0][1-9]
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
a
"Stuart Dallas" wrote in message
news:79538829-bfc4-43a4-a413-72247b145...@3ft9.com...
On 18 May 2012, at 14:41, Jim Giner wrote:
> "Stuart Dallas" 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 und
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
On 18 May 2012, at 14:41, Jim Giner wrote:
> "Stuart Dallas" 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 err
"Stuart Dallas" 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 (which
> I
> c
On Fri, May 18, 2012 at 7:34 PM, Stuart Dallas 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 valid_time_Shiplu2($time) {
s
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 th
"Jim Lucas" wrote in message
news:4fb5decc.20...@cmsws.com...
> On 5/17/2012 9:52 PM, Jim Lucas wrote:
>>
>> How about this instead?
>>
>> >
>> $times = array(
>> '100', # valid
>> '1100', # valid
>> '1300', # invalid
>> '01:00', # valid
>> '12:59', # valid
>> '00:01', # valid
>> '00:25pm', # in
"Jim Lucas" wrote in message
news:4fb5decc.20...@cmsws.com...
> On 5/17/2012 9:52 PM, Jim Lucas wrote:
>>
>> How about this instead?
>>
>> >
>> $times = array(
>> '100', # valid
>> '1100', # valid
>> '1300', # invalid
>> '01:00', # valid
>> '12:59', # valid
>> '00:01', # valid
>> '00:25pm', # in
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, -2)
On 5/17/2012 9:52 PM, Jim Lucas wrote:
How about this instead?
\d{1,2}):?(?P\d{2})$#', $time, $m);
if (
$m &&
( 0 <= (int) $m['hour'] && 12 >= (int) $m['hour'] ) &&
( 0 <= (int) $m['minute'] && 59 >= (int) $m['minute'] )
) {
return TRUE;
}
return false;
}
Let me know.
I optimized it a li
On 5/17/2012 8:07 PM, Jim Giner wrote:
"Jim Lucas" 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
Ginerwrote:
ok - finally had to come up with my own regexp - and am failing.
Trying to validate an input of a time
"Jim Lucas" 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
>> Ginerwrote:
>>
>>> 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
On 5/17/2012 1:57 PM, shiplu wrote:
On Fri, May 18, 2012 at 2:37 AM, Jim Ginerwrote:
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 h
Thank you !
"Govinda" 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 pattern (needle) in the
>
> 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
"Yared Hufkens" 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 regex
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 h
On Fri, May 18, 2012 at 2:37 AM, Jim Giner 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 hour format. My prob
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 (0
On Fri, Oct 15, 2010 at 11:07 AM, Richard Quadling wrote:
> On 15 October 2010 15:45, Andrew Ballard wrote:
>> On Fri, Oct 15, 2010 at 5:52 AM, Richard Quadling
>> wrote:
>>> On 15 October 2010 10:16, Ford, Mike wrote:
> -Original Message-
> From: Andre Polykanine [mailto:an...
On 15 October 2010 15:45, Andrew Ballard wrote:
> On Fri, Oct 15, 2010 at 5:52 AM, Richard Quadling wrote:
>> On 15 October 2010 10:16, Ford, Mike wrote:
-Original Message-
From: Andre Polykanine [mailto:an...@oire.org]
Sent: 14 October 2010 21:42
Hi everyone,
>>
On Fri, Oct 15, 2010 at 5:52 AM, Richard Quadling wrote:
> On 15 October 2010 10:16, Ford, Mike 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 lo
On 15 October 2010 10:16, Ford, Mike 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 regexp that
> -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
On 14 October 2010 21:42, Andre Polykanine 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 do
On Thu, Oct 14, 2010 at 1:42 PM, Andre Polykanine 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 extract the nu
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 (attenti
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
> ('a:3:{s:12:"F1";s:6:"nombre";s:11:"F2";s:5:"F3"
> 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
>
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`
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
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
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.co
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
> >
> > S
> 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
> 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]
> &
> -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
>
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>\( href=\"http:\/\/www.thiswebsite.com\/some-script.php\">fir.*?st
> word.*?(.*)Word2:<\/a><\/h4>(.*)Second
> word:<\/a><\/h4>(.*)Word3:<\/a><\/h4>(.*)rd
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
> >
> 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
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>\( href=\"http:\/\/www.thiswebsite.com\/some-script.php\">fir.*?st
> word.*?(.*)Word2:<\/a><\/h4>(.*)Second
> word:<\/
I think we've not so much only with the regex, but maybe you can tell me
somethin helpful ;)
/Word1:<\/a><\/h4>\(fir.*?st
word.*?(.*)Word2:<\/a><\/h4>(.*)Second
word:<\/a><\/h4>(.*)Word3:<\/a><\/h4>(.*)rd word/is
Thanks.
I.Lopez.
>>
On 05/11/2010 09:56 AM, Spud. Ivan. wrote:
>
> But it
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 unsub
4.3.0
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:2
> -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 questions
>
>
> Is there any place where to read the changelog or something?
Um, you mean, like,
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
___
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 distinguis
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.
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, 201
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 =
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 Steve
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
,
> 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
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 (http://www.php.ne
ard Lynch [mailto:[EMAIL PROTECTED]
Sent: Saturday, December 16, 2006 3:55 AM
To: WeberSites LTD
Cc: php-general@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 :
>
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 th
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'
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.
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 summat
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
Thanks,
But this example seems to be short and does the job :
Unless I'm missing something?
thanks
-Original Message-
From: Richard Lynch [mailto:[EMAIL PROTECTED]
Sent: Saturday, April 29, 2006 10:29 AM
To: Weber Sites LTD
Cc: php-general@lists.php.net
Subject: Re: [PHP] RegEx
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 " " t
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 wa
tes LTD; php-general@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
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
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
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']))
"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']);
if($_REQU
[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 express
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 t
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 i
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:
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 it
Andy Pieters wrote:
> Hi list
>
> I still fail to understand why regular expressions are causing me such a hard
> time.
>
>
Hi!
Why don't you use 'preg_match'? And why do you use all those character
classes?
This:
$subject = 'Nov 22 06:51:36';
$pattern = '/^(\w{3})\s(\d{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 s
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})'
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:
---
http://www.php.net/index.php> key=value ";
echo 'Normal HTML:';
echo $html;
echo "";
$improved_html = preg_
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
"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:
>> ---
>> > style='font-size:12.0pt;font-fami
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:
> ---
> style='font-size:12.0pt;font-family:"Comic Sans MS"'>
I'm guessing that you're writing a function to parse "HTML" that
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:
---
http://www.php.net/index.php> key=value ";
echo 'Normal HTML:';
echo $html;
Eli wrote:
BlackDex wrote:
Hello ppl,
I have a question about regex and html parsing.
I have the following code:
---
style='font-size:12.0pt;font-family:"Comic Sans
MS"'>
you realise that that HTML ammounts the to the display of a
SINGLE space!!! that what I call progress... 144+ bytes to displ
Sorry for the spam.. here it is:
function tag_rep($tag)
{
return
preg_replace('/(?
}
$html="http://www.php.net/index.php> key=value ";
$improved_html=preg_replace('/\<(.*)\>/Ue','"<".tag_rep("\1").">"',$html);
echo str_replace("\\'","'",$improved_html);
?>
:)
--
PHP General Mailing List (htt
Yup.. that was a good point.. ;)
Take a look at this example:
function tag_rep($tag)
{
return
reg_replace('/(?
}
$html="http://www.php.net/index.php> key=value ";
$improved_html=preg_replace('/\<(.*)\>/Ue','"<".tag_rep("\1").">"',$html);
echo str_replace("\'","'",$improved_html);
?>
--
PHP
"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
"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
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 un
BlackDex wrote:
Hello ppl,
I have a question about regex and html parsing.
I have the following code:
---
---
It laks some quotemarks.
I want to change it to:
---
---
So it will have " around the attribute values...
But i can't figure out how to do that :(.
Can anyone help me with this??
Thx in
Hello ppl,
I have a question about regex and html parsing.
I have the following code:
---
---
It laks some quotemarks.
I want to change it to:
---
---
So it will have " around the attribute values...
But i can't figure out how to do that :(.
Can anyone help me with this??
Thx in advance.
K
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 list
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 ) but some more advanced pattern
matching is not. I haven't changed the code, but the php-version
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 ) but some more advanced pattern
matching is not. I haven't changed the code, but the php-version on the
server has change
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 te
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
1 - 100 of 189 matches
Mail list logo