I'm a very beginner PHP programmer.
I want to create a search function for the first time, as well as an email verification by myself. I learned a little about regular expressions in Java, but I don't know how exactly to use them in PHP.
For example, how would I use the example "\\w{3,}@\\w{2,}\.\\ w{2,}
? (and, are there errors in this code?) It is very simple and not very secure, as it is just a test site.
In Java, I can use Pattern.compile()
and pattern.matcher()
and matcher.find()
to find matches. What is the PHP equivalent?
I've searched around a little bit - they all give examples on how to create good regular expressions, but I don't know what the syntax is for utilizing them.
Could somebody explain this to me, or redirect me to a useful site?
Thanks in advance.