Ninjakreborn Posted April 20, 2006 Share Posted April 20, 2006 What are the purposes of the following< please note I have done extensive research, I found alot of tutorials telling me about them, how to utilize them, this is great, but what is the "purpose" of them, in general programming when will the "need" arise for me to have to use itpreg_match()preg_matchall()and other things of those nature, if you have some ideas I would appreciate it, if I know there is a reason then we can work something. Quote Link to comment https://forums.phpfreaks.com/topic/7960-regular-expressions/ Share on other sites More sharing options...
ToonMariner Posted April 20, 2006 Share Posted April 20, 2006 Regular expression allow you to check/manipulate large strings based on very small parts of it.An example -Like this site where ever someone enters the word 'php' you want to link it to php.netstring is "I progam in php because it is not made by microsoft and its dead nice and you can do loads with php."$string = preg_replace('/(php)(\.| )/','<a href="http://www.php.net">\\1</a>\\2',$string);should return...I progam in <a href="http://www.php.net">php</a> because it is not made by microsoft and its dead nice and you can do loads with <a href="http://www.php.net">php</a>.Basically it allows you to control all manner of aspects of the string or get all manner of info from a string based on small parts of it without you having to know the exact content of the string before hand. Quote Link to comment https://forums.phpfreaks.com/topic/7960-regular-expressions/#findComment-29017 Share on other sites More sharing options...
Ninjakreborn Posted April 20, 2006 Author Share Posted April 20, 2006 thanks that gives me some ideas on test programs to learn, I appreciate the "example" thanks. Quote Link to comment https://forums.phpfreaks.com/topic/7960-regular-expressions/#findComment-29026 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.