AyKay47 Posted March 7, 2012 Share Posted March 7, 2012 Is anyone else noticing unexpected behavior with regex functions like preg_match() etc. on codepad.viper-7.com? A few tests I have performed have not shown any results at all. A pattern like '~.*~'; isn't matching anything when the $subject argument is certain things, other times it will match everything in the $subject argument, very strange. I haven't ran enough tests to determine what exactly in the $subject arguments is causing this, just wondering if anyone else has experienced this. Quote Link to comment https://forums.phpfreaks.com/topic/258468-codepadviper-regular-expression-behavior/ Share on other sites More sharing options...
scootstah Posted March 7, 2012 Share Posted March 7, 2012 I can't answer your question because I've never used that site, but I would like to add that the Regular Expressions Tester Firefox add-on is pretty awesome for that. Quote Link to comment https://forums.phpfreaks.com/topic/258468-codepadviper-regular-expression-behavior/#findComment-1324869 Share on other sites More sharing options...
Adam Posted March 8, 2012 Share Posted March 8, 2012 Do you have an example we can use to reproduce the problem? Saying "sometimes it doesn't work" is about as ambiguous as saying there's a security hole in IE6. Quote Link to comment https://forums.phpfreaks.com/topic/258468-codepadviper-regular-expression-behavior/#findComment-1325155 Share on other sites More sharing options...
AyKay47 Posted March 8, 2012 Author Share Posted March 8, 2012 Do you have an example we can use to reproduce the problem? Saying "sometimes it doesn't work" is about as ambiguous as saying there's a security hole in IE6. heh, yeah sure. http://codepad.viper-7.com/20Gd51 it seems that tags are now stripped or something of the sort. The behavior seems kind of random to me, as sometimes it parses the string fine and sometimes its stripped. This behavior did not occur until maintenance was performed on the site about 2 weeks ago. Quote Link to comment https://forums.phpfreaks.com/topic/258468-codepadviper-regular-expression-behavior/#findComment-1325169 Share on other sites More sharing options...
kicken Posted March 8, 2012 Share Posted March 8, 2012 http://codepad.viper-7.com/N4SqUv You should put it in plain text mode when you test things by sending the appropriate header. Quote Link to comment https://forums.phpfreaks.com/topic/258468-codepadviper-regular-expression-behavior/#findComment-1325177 Share on other sites More sharing options...
AyKay47 Posted March 8, 2012 Author Share Posted March 8, 2012 http://codepad.viper-7.com/N4SqUv You should put it in plain text mode when you test things by sending the appropriate header. right but I shouldn't need to do that every time. things like this used to work fine on codepad.viper-7. I guess they changed the content-type from text/plain Quote Link to comment https://forums.phpfreaks.com/topic/258468-codepadviper-regular-expression-behavior/#findComment-1325179 Share on other sites More sharing options...
kicken Posted March 8, 2012 Share Posted March 8, 2012 as far as I know it's always been text/html output. There used to be a tab at the top that let you switch between html or plain text and that seems to be gone now. Maybe it remembered your selection so it went to plain text for you by default, not sure if it did that or not. Quote Link to comment https://forums.phpfreaks.com/topic/258468-codepadviper-regular-expression-behavior/#findComment-1325183 Share on other sites More sharing options...
AyKay47 Posted March 8, 2012 Author Share Posted March 8, 2012 as far as I know it's always been text/html output. There used to be a tab at the top that let you switch between html or plain text and that seems to be gone now. Maybe it remembered your selection so it went to plain text for you by default, not sure if it did that or not. very well could have, I guess I will have to use a header to get to the proper content-type. Thanks for the help. Quote Link to comment https://forums.phpfreaks.com/topic/258468-codepadviper-regular-expression-behavior/#findComment-1325184 Share on other sites More sharing options...
salathe Posted March 13, 2012 Share Posted March 13, 2012 It used to default to the HTML view, then was changed to the Source view. Now with the new design it is back to the HTML view. I have always just forced a plain text output from within the code, with things like header("Content-Type: text/plain") or ini_set("default_mimetype", "text/plain"). Quote Link to comment https://forums.phpfreaks.com/topic/258468-codepadviper-regular-expression-behavior/#findComment-1326984 Share on other sites More sharing options...
AyKay47 Posted March 14, 2012 Author Share Posted March 14, 2012 It used to default to the HTML view, then was changed to the Source view. Now with the new design it is back to the HTML view. I have always just forced a plain text output from within the code, with things like header("Content-Type: text/plain") or ini_set("default_mimetype", "text/plain"). yeah, I have started to do the same now. thanks Sal Quote Link to comment https://forums.phpfreaks.com/topic/258468-codepadviper-regular-expression-behavior/#findComment-1327078 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.