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
RE: [PHP] regexp questions
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 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
RE: [PHP] regexp questions
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
RE: [PHP] regexp questions
-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 searching for pcre: Version 5.3.2 Upgraded bundled PCRE to version 8.00. Version 5.3.0 Upgraded bundled PCRE to version 7.9. Version 5.2.13 Upgraded bundled PCRE to version 7.9. Version 5.2.9 Fixed bug #44336 (Improve pcre UTF-8 string matching performance). Version 5.2.7 Upgraded PCRE to version 7.8 Version 5.2.6 Upgraded PCRE to version 7.6 Version 5.2.5 Upgraded PCRE to version 7.3 Version 5.2.4 Upgraded PCRE to version 7.2 Version 5.2.2 Upgraded PCRE to version 7.0 Version 5.2.0 Updated PCRE to version 6.7 ... so it looks like between PHP 5.1 and 5.3.2 you have at least 2 major version upgrades of the PCRE library, so the previously referenced http://www.pcre.org/changelog.txt is more than likely what you need to be looking at. Cheers! Mike -- Mike Ford, Electronic Information Developer, Libraries and Learning Innovation, Leeds Metropolitan University, C507, Civic Quarter Campus, Woodhouse Lane, LEEDS, LS1 3HE, United Kingdom Email: m.f...@leedsmet.ac.uk Tel: +44 113 812 4730 To view the terms under which this email is distributed, please go to http://disclaimer.leedsmet.ac.uk/email.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] regexp questions
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@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 searching for pcre: Version 5.3.2 Upgraded bundled PCRE to version 8.00. Version 5.3.0 Upgraded bundled PCRE to version 7.9. Version 5.2.13 Upgraded bundled PCRE to version 7.9. Version 5.2.9 Fixed bug #44336 (Improve pcre UTF-8 string matching performance). Version 5.2.7 Upgraded PCRE to version 7.8 Version 5.2.6 Upgraded PCRE to version 7.6 Version 5.2.5 Upgraded PCRE to version 7.3 Version 5.2.4 Upgraded PCRE to version 7.2 Version 5.2.2 Upgraded PCRE to version 7.0 Version 5.2.0 Updated PCRE to version 6.7 ... so it looks like between PHP 5.1 and 5.3.2 you have at least 2 major version upgrades of the PCRE library, so the previously referenced http://www.pcre.org/changelog.txt is more than likely what you need to be looking at. Cheers! Mike -- Mike Ford, Electronic Information Developer, Libraries and Learning Innovation, Leeds Metropolitan University, C507, Civic Quarter Campus, Woodhouse Lane, LEEDS, LS1 3HE, United Kingdom Email: m.f...@leedsmet.ac.uk Tel: +44 113 812 4730 To view the terms under which this email is distributed, please go to http://disclaimer.leedsmet.ac.uk/email.htm Thank you very much, this was very useful ;) I. Lopez. _ ¿Quieres conocer trucos de Windows 7? ¡Los que ya lo usan te los cuentan! http://www.sietesunpueblodeexpertos.com/index_windows7.html
RE: [PHP] regexp questions
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:\/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 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
RE: [PHP] regexp questions
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 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 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
RE: [PHP] regexp questions
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 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:\/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 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
RE: [PHP] regexp questions
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: 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:\/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 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
Re: [PHP] regexp questions
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 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 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 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 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
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 Version Description 5.2.2 Named subpatterns now accept the syntax (?name) and (?'name') as well as (?Pname). Previous versions accepted only (?Pname). 4.3.3 The offset parameter was added 4.3.0 The PREG_OFFSET_CAPTURE flag was added 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: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, http://php.net/changelog ?? ;) Cheers! Mike -- Mike Ford, Electronic Information Developer, Libraries and Learning Innovation, Leeds Metropolitan University, C507, Civic Quarter Campus, Woodhouse Lane, LEEDS, LS1 3HE, United Kingdom Email: m.f...@leedsmet.ac.uk Tel: +44 113 812 4730 _ Disfruta de Messenger y Hotmail en tu BlackBerry ¡Hazlo ya! http://serviciosmoviles.es.msn.com/messenger/blackberry.aspx
Re: [PHP] regexp questions
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 unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] regexp questions
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 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 unsubscribe, visit: http://www.php.net/unsub.php _ Disfruta de Messenger y Hotmail en tu BlackBerry ¡Hazlo ya! http://serviciosmoviles.es.msn.com/messenger/blackberry.aspx
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 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 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 unsubscribe, visit: http://www.php.net/unsub.php _ Disfruta de Messenger y Hotmail en tu BlackBerry ¡Hazlo ya! http://serviciosmoviles.es.msn.com/messenger/blackberry.aspx What are you trying to match the regex against? Also, I've noticed you've used a lot of periods (.) where it looks like you intended a literal period to be matched. In regular expressions, periods match any character expect the newline, so www.thiswebsite.com would also match the string www_thiswebsite_com. Ps, please try not to top post, as it disrupts the zen flow of the list! :) Thanks, Ash http://www.ashleysheridan.co.uk
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'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 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 unsubscribe, visit: http://www.php.net/unsub.php _ Disfruta de Messenger y Hotmail en tu BlackBerry ¡Hazlo ya! http://serviciosmoviles.es.msn.com/messenger/blackberry.aspx What are you trying to match the regex against? Also, I've noticed you've used a lot of periods (.) where it looks like you intended a literal period to be matched. In regular expressions, periods match any character expect the newline, so www.thiswebsite.com would also match the string www_thiswebsite_com. Ps, please try not to top post, as it disrupts the zen flow of the list! :) Thanks, Ash http://www.ashleysheridan.co.uk Ok I'm sorry for top posting ;) Sure, I know that . match any character, but only one and It doesn't matter to me if it's . or _ , it's ok I think. The problem is that if I test it in a small string, it works, but if I take the 30kb html source, it only works with php versions older than 5.2 So, I think you wan't not to test the regexp within the original file, (or yes? :) ) I.Lopez. _ Diseñar aplicaciones tiene premio. ¡Si eres desarrollador no esperes más! http://www.imaginemobile.es
RE: [PHP] regexp questions
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: 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 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 unsubscribe, visit: http://www.php.net/unsub.php _ Disfruta de Messenger y Hotmail en tu BlackBerry ¡Hazlo ya! http://serviciosmoviles.es.msn.com/messenger/blackberry.aspx What are you trying to match the regex against? Also, I've noticed you've used a lot of periods (.) where it looks like you intended a literal period to be matched. In regular expressions, periods match any character expect the newline, so www.thiswebsite.com would also match the string www_thiswebsite_com. Ps, please try not to top post, as it disrupts the zen flow of the list! :) Thanks, Ash http://www.ashleysheridan.co.uk Ok I'm sorry for top posting ;) Sure, I know that . match any character, but only one and It doesn't matter to me if it's . or _ , it's ok I think. The problem is that if I test it in a small string, it works, but if I take the 30kb html source, it only works with php versions older than 5.2 So, I think you wan't not to test the regexp within the original file, (or yes? :) ) I.Lopez. _ Diseñar aplicaciones tiene premio. ¡Si eres desarrollador no esperes más! http://www.imaginemobile.es Is it possible that you're running out of memory for this script? Increase the memory a script can use in php.ini to see if this helps. If that doesn't, can you determine the exact maximum filesize you can process with this regular expression? It could be you've found a bug in the regex parser perhaps? Thanks, Ash http://www.ashleysheridan.co.uk
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\/h4ul(.*)Second word:\/a\/h4ul(.*)Word3:\/a\/h4ul(.*)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 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] regexp questions
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 distinguishes bet ... ... (ask Steve Jobs the rest -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] regexp questions
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 _ Disfruta de Messenger y Hotmail en tu BlackBerry ¡Hazlo ya! http://serviciosmoviles.es.msn.com/messenger/blackberry.aspx