From: Ashley Sheridan on
On Wed, 2010-05-12 at 18:23 +0200, Spud. Ivan. wrote:

>
>
>
>
> Subject: RE: [PHP] regexp questions
> From: ash(a)ashleysheridan.co.uk
> To: spudmixe(a)hotmail.com
> CC: php-general(a)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: lists(a)cmsws.com
> > To: spudmixe(a)hotmail.com
> > CC: php-general(a)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:<\/a><\/h4>\(<a href=\"http:\/\/www.thiswebsite.com\/some-script.php\">fir.*?st word.*?(.*)Word2:<\/a><\/h4><ul>(.*)Second word:<\/a><\/h4><ul>(.*)Word3:<\/a><\/h4><ul>(.*)rd word/is
> > >
> > > Thanks.
> > > I.Lopez.
> > >
> > > 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.
> > >
> > >
> >
> > Again...
> >
> > Why don't you show us an example of what it is you are trying to match this
> > against. Then, after that example, show us what you would like to see as the
> > output.
> >
> > Then, send us a copy of the code you are trying to use to make it all happen.
> >
> > --
> > Jim Lucas
> >
> > "Some men are born to greatness, some achieve greatness,
> > and some have greatness thrust upon them."
> >
> > Twelfth Night, Act II, Scene V
> > by William Shakespeare
>
>
>
>
> I'm sorry Jim, but as majority of regexp, I can't explain you what I want with words...
>
> I simply want to pick specific text at very specific places inside the html.
>
>
>
> I'm sending you to your email the html and regex so you can test it if you want :)
>
>
>
> Thanks.
>
> I. Lopez.
>
>
>
> _________________________________________________________________
> Consejos para seducir ¿Puedes conocer gente nueva a través de Internet? ¡Regístrate ya!
> http://contactos.es.msn.com/?mtcmk=015352
>
> It might be better to use some of the DOM functions for something like this. You can pull out specific tags and tag content as you need. It's better to rely on DOM functions for these sorts of things than using regular expressions.
>
>
>
>
>
>
> Thanks,
> Ash
> http://www.ashleysheridan.co.uk
>
>
>
> >
>
>
>
>
>
> But If I remove tags, I can't match this specific place, because are just these tags who distinct the place where to match.
>
>
>
> I.Lopez.
>
>
>
>
> _________________________________________________________________
> Consejos para seducir ¿Puedes conocer gente nueva a través de Internet? ¡Regístrate ya!
> http://contactos.es.msn.com/?mtcmk=015352


It depends what you need to do. If you want to match specific tags, then
something like getElementsByTagName() (I believe this function exists in
the set of DOM functions) would very easily grab all those tags so you
can work on them. I don't see much that a regex could do here that the
DOM can't handle.

Thanks,
Ash
http://www.ashleysheridan.co.uk


From: Karl DeSaulniers on

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: ash(a)ashleysheridan.co.uk
>> To: spudmixe(a)hotmail.com
>> CC: php-general(a)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: lists(a)cmsws.com
>>> To: spudmixe(a)hotmail.com
>>> CC: php-general(a)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:<\/a><\/h4>\(<a href=\"http:\/\/www.thiswebsite.com\/some-
>>>> script.php\">fir.*?st word.*?(.*)Word2:<\/a><\/h4><ul>(.*)Second
>>>> word:<\/a><\/h4><ul>(.*)Word3:<\/a><\/h4><ul>(.*)rd word/is
>>>>
>>>> Thanks.
>>>> I.Lopez.
>>>>
>>>> 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.
>>>>
>>>>
>>>
>>> Again...
>>>
>>> Why don't you show us an example of what it is you are trying to
>>> match this
>>> against. Then, after that example, show us what you would like to
>>> see as the
>>> output.
>>>
>>> Then, send us a copy of the code you are trying to use to make it
>>> all happen.
>>>
>>> --
>>> Jim Lucas
>>>
>>> "Some men are born to greatness, some achieve greatness,
>>> and some have greatness thrust upon them."
>>>
>>> Twelfth Night, Act II, Scene V
>>> by William Shakespeare
>>
>>
>>
>>
>> I'm sorry Jim, but as majority of regexp, I can't explain you what
>> I want with words...
>>
>> I simply want to pick specific text at very specific places
>> inside the html.
>>
>>
>>
>> I'm sending you to your email the html and regex so you can test
>> it if you want :)
>>
>>
>>
>> Thanks.
>>
>> I. Lopez.
>>
>>
>>
>> _________________________________________________________________
>> Consejos para seducir ¿Puedes conocer gente nueva a través de
>> Internet? ¡Regístrate ya!
>> http://contactos.es.msn.com/?mtcmk=015352
>>
>> It might be better to use some of the DOM functions for something
>> like this. You can pull out specific tags and tag content as you
>> need. It's better to rely on DOM functions for these sorts of
>> things than using regular expressions.
>>
>>
>>
>>
>>
>>
>> Thanks,
>> Ash
>> http://www.ashleysheridan.co.uk
>>
>>
>>
>>>
>>
>>
>>
>>
>>
>> But If I remove tags, I can't match this specific place, because
>> are just these tags who distinct the place where to match.
>>
>>
>>
>> I.Lopez.
>>
>>
>>
>>
>> _________________________________________________________________
>> Consejos para seducir ¿Puedes conocer gente nueva a través de
>> Internet? ¡Regístrate ya!
>> http://contactos.es.msn.com/?mtcmk=015352
>
>
> It depends what you need to do. If you want to match specific tags,
> then
> something like getElementsByTagName() (I believe this function
> exists in
> the set of DOM functions) would very easily grab all those tags so you
> can work on them. I don't see much that a regex could do here that the
> DOM can't handle.
>
> Thanks,
> Ash
> http://www.ashleysheridan.co.uk
>
>

Dont know if you found your solution or not, but here is a good
website for regexp.

http://lawrence.ecorp.net/inet/samples/regexp-intro.php

HTH,


Karl DeSaulniers
Design Drumm
http://designdrumm.com

From: "Spud. Ivan." on



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 (\'a:3:{s:12:\"F1\";s:6:\"nombre\";s:11:\"F2\";s:5:\"F3\";s:16:\"F4\";s:10:\"F5\";}\');



and of course it's not a valid SQL sentence.



Why can't I escape an SQL value with " ???



Regards.



I.Lopez.





_________________________________________________________________
¿Quieres conocer trucos de Windows 7? ¡Los que ya lo usan te los cuentan!
http://www.sietesunpueblodeexpertos.com/index_windows7.html
From: "Spud. Ivan." on




> From: spudmixe(a)hotmail.com
> To: php-general(a)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 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 (\'a:3:{s:12:\"F1\";s:6:\"nombre\";s:11:\"F2\";s:5:\"F3\";s:16:\"F4\";s:10:\"F5\";}\');
>
>
>
> and of course it's not a valid SQL sentence.
>
>
>
> Why can't I escape an SQL value with " ???
>
>
>
> Regards.
>
>
>
> I.Lopez.
>
>
>
>
>
> _________________________________________________________________
> ¿Quieres conocer trucos de Windows 7? ¡Los que ya lo usan te los cuentan!
> http://www.sietesunpueblodeexpertos.com/index_windows7.html






I'm sorry, I mistaked the subject

_________________________________________________________________
Consejos para seducir ¿Puedes conocer gente nueva a través de Internet? ¡Regístrate ya!
http://contactos.es.msn.com/?mtcmk=015352
From: Ashley Sheridan on
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";s:16:"F4";s:10:"F5";}');
>
>
>
> it result in
>
> 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\";}\');
>
>
>
> and of course it's not a valid SQL sentence.
>
>
>
> Why can't I escape an SQL value with " ???
>
>
>
> Regards.
>
>
>
> I.Lopez.
>
>
>
>
>
> _________________________________________________________________
> ¿Quieres conocer trucos de Windows 7? ¡Los que ya lo usan te los cuentan!
> http://www.sietesunpueblodeexpertos.com/index_windows7.html


It appears that you're performing the mysql_real_escape_string on the
entire query, and not the variables you're using in your query, hence
the single quotes that denote an SQL string being escaped.

Thanks,
Ash
http://www.ashleysheridan.co.uk