Can anyone tell me where I could start learning the usage of regular expressions in mvc applications?
Thanks Ritz
Can anyone tell me where I could start learning the usage of regular expressions in mvc applications?
Thanks Ritz
You're going to need to be more specific about what you're trying to do, and what you're working with. Regex and M-V-C at an abstract level have nothing to do with one another.
This is a good source to start with regex in general: http://www.regular-expressions.info
This is a good source to start with MVC in general: http://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller
Note that they both have nothing to do with each other. If your question is actually more "Where do I use business logic in MVC applications?" or "Where do I use validation logic in MVC applications?" (both might include regex logic) then just ask that so. It's answered in the most MVC related articles/tutorials though.
Regulazy (download link) is a very useful tool when learning regular expressions.
It doesn't matter whether it's an MVC application or some other kind of application- regexs are used for matching patterns in a string. So, if you need to match a pattern in a string, a regex is a good idea. If you don't need to match a pattern in a string, you don't need a regex. Note that regexes have limitations and sometimes you want an actual parser instead of just a regex.
I highly recommend the book, Mastering Regular Expressions, Second Edition by Jeffrey E. F. Friedl (published by O'Reilly). I thought I knew regular expressions when I got this; I mostly bought it as a reference book for some of the more obtuse syntaxes (eg, backward looking non-consuming non-capturing matches). It turns out there was a lot I didn't know about RegExp, and this is one of few technical manuals that I've actually just sat down and read straight up.
For regex in general, I agree with BalusC on regular-expressions.info. You might also try playing around with Expresso and test strings to try and flesh out your understanding of regular expressions.
As others have already mentioned, regex has little to do with what type of application you are attempting to make.
Hi.Cats Who Code has a great article called 15 PHP Regular Expressions for Webdevelopers... very simple to learn:
http://www.catswhocode.com/blog/15-php-regular-expressions-for-web-developers
Regards