PHP - Moved: (simple) Escaping In Regex?
This topic has been moved to PHP Regex.
http://www.phpfreaks.com/forums/index.php?topic=353729.0 Similar TutorialsQuote from: Mike Solstice on April 14, 2011, 12:24:45 AM Ok, that works if I run it CLI or though phpMyAdmin, but won't if I try it in php Code: [Select] $remcomma = "UPDATE top_train SET deaths = replace( replace(field_name, ',', ''), '"', '' )"; mysql_query($remcomma); I assume because of the quotes used in the regex. I tried escaping the " Code: [Select] $remcomma = "UPDATE top_train SET deaths = replace( replace(field_name, ',', ''), '\"', '' )"; mysql_query($remcomma); Which broke it altogether. Anyone have any ideas? Thanks! Moved here since that thread was marked as solved & it's more of a PHP issue at this point anyway. Any & all help is greatly appreciated! This topic has been moved to PHP Regex. http://www.phpfreaks.com/forums/index.php?topic=349116.0 Given the below rules and following browser input: user/joe/x Hi Guys. This should- hopefully- be a pretty simple question for someone with regex experience to answer. I've been reading all the regex guides and tried various things but none have worked and I'm starting to get a headache. I've decided to just pitch the question here. How do I test if a string contains ONLY a certain character- but could be one or more instances of that character. In this case it's a comma. So: ',' -> Would return TRUE ',,,' -> Would return TRUE ',,,,,,,' -> Would return TRUE ',,,hello,' -> Would return FALSE 'hi,,,' -> Would return FALSE Thanks in advance! This topic has been moved to PHP Regex. http://www.phpfreaks.com/forums/index.php?topic=308051.0 This topic has been moved to PHP Regex. http://www.phpfreaks.com/forums/index.php?topic=356497.0 This topic has been moved to PHP Regex. http://www.phpfreaks.com/forums/index.php?topic=326775.0 This topic has been moved to PHP Regex. http://www.phpfreaks.com/forums/index.php?topic=358535.0 This topic has been moved to PHP Regex. http://www.phpfreaks.com/forums/index.php?topic=356424.0 This topic has been moved to PHP Regex. http://www.phpfreaks.com/forums/index.php?topic=344155.0 This topic has been moved to PHP Regex. http://www.phpfreaks.com/forums/index.php?topic=317764.0 This topic has been moved to PHP Regex. http://www.phpfreaks.com/forums/index.php?topic=320857.0 This topic has been moved to PHP Regex. http://www.phpfreaks.com/forums/index.php?topic=353870.0 This topic has been moved to PHP Regex. http://www.phpfreaks.com/forums/index.php?topic=347186.0 This topic has been moved to PHP Regex. http://www.phpfreaks.com/forums/index.php?topic=307000.0 This topic has been moved to PHP Regex. http://www.phpfreaks.com/forums/index.php?topic=308636.0 This topic has been moved to PHP Regex. http://www.phpfreaks.com/forums/index.php?topic=320895.0 This topic has been moved to PHP Regex. http://www.phpfreaks.com/forums/index.php?topic=332077.0 This topic has been moved to PHP Regex. http://www.phpfreaks.com/forums/index.php?topic=350701.0 |