PHP - Moved: Preg_match Question
This topic has been moved to PHP Regex.
http://www.phpfreaks.com/forums/index.php?topic=357263.0 Similar TutorialsThis topic has been moved to PHP Regex. http://www.phpfreaks.com/forums/index.php?topic=355835.0 This topic has been moved to PHP Regex. http://www.phpfreaks.com/forums/index.php?topic=323604.0 This topic has been moved to PHP Regex. http://www.phpfreaks.com/forums/index.php?topic=331694.0 This topic has been moved to PHP Regex. http://www.phpfreaks.com/forums/index.php?topic=320132.0 This topic has been... uh... whatsit... moved? to PHP Regex. http://www.phpfreaks.com/forums/index.php?topic=353911.0 I have this $val="my friend is a female"; how to check whether a word "male" is there or not using preg_match() i wish to get FALSE result for that case and TRUE if i modify a bit into $val="both male/female" thanks in advance! This topic has been moved to PHP Regex. http://www.phpfreaks.com/forums/index.php?topic=318181.0 This topic has been moved to PHP Regex. http://www.phpfreaks.com/forums/index.php?topic=348975.0 This topic has been moved to PHP Regex. http://www.phpfreaks.com/forums/index.php?topic=317682.0 This topic has been moved to PHP Regex. http://www.phpfreaks.com/forums/index.php?topic=314652.0 This topic has been moved to PHP Regex. http://www.phpfreaks.com/forums/index.php?topic=318058.0 This topic has been moved to PHP Regex. http://www.phpfreaks.com/forums/index.php?topic=329322.0 This topic has been moved to PHP Regex. http://www.phpfreaks.com/forums/index.php?topic=329803.0 I have searched a lot but no information about this aspect. I wonder how much heavy is the process of getting parts of a webpage by preg_match? But my question is that which of these options are in favor of lighter CPU process: 1. getting each item between specified tags by a preg_match or 2. First getting the content between <body>, then processing by php tools such as preg_match (again), explode, etc. Thanks for considering this unusual question Hi, I'm using preg_match to validate various fields. I wish to check that a string the length of four numbers, as a year, eg. 2010. How would I do this, something like: Code: [Select] /^[0-9'\s]{4}*$/i? As usual, I have no idea. Why oh why does this not work?
<?php
if (preg_match("[0-9]", "2")) { This topic has been moved to PHP Regex. http://www.phpfreaks.com/forums/index.php?topic=315924.0 This topic has been moved to PHP Regex. http://www.phpfreaks.com/forums/index.php?topic=345873.0 This topic has been moved to PHP Regex. http://www.phpfreaks.com/forums/index.php?topic=345218.0 This topic has been moved to PHP Regex. http://www.phpfreaks.com/forums/index.php?topic=327702.0 |