Preg Match Woes

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Bigun
Forum Contributor
Posts: 237
Joined: Tue Jun 13, 2006 10:50 am

Preg Match Woes

Post by Bigun »

I've been Googling for decent tutorials and I've also searched here. I can't find anything that my brain can comprehend.

The best I could find was this: http://phptutorial.info/?preg-match

Which is an exact copy of this: http://us2.php.net/preg-match

:?

Anyway, I'm not asking for a private tutor, but I am asking for someone to explain this function in plain Engrish for me.
User avatar
JayBird
Admin
Posts: 4524
Joined: Wed Aug 13, 2003 7:02 am
Location: York, UK
Contact:

Post by JayBird »

Try reading the stickies in the Regex forum - viewforum.php?f=38
User avatar
Jenk
DevNet Master
Posts: 3587
Joined: Mon Sep 19, 2005 6:24 am
Location: London

Post by Jenk »

preg* functions allow the use of Perl Compatible Regular Expressions

It's realy just soemthing you have to dive into.. at least for me it's really difficult to describe how to use it.

Download Regex Coach for practicing and have a read through the crash course stickies/threads in the Regex forum on this site.
Bigun
Forum Contributor
Posts: 237
Joined: Tue Jun 13, 2006 10:50 am

Post by Bigun »

Is there a big difference between preg match and regex?
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Post by s.dot »

preg_match() uses regex to find a match in a text string

Code: Select all

preg_match("/regex here/", $textstring);
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
Bigun
Forum Contributor
Posts: 237
Joined: Tue Jun 13, 2006 10:50 am

Post by Bigun »

I found this, also quite useful for building regex expressions.

http://txt2regex.sourceforge.net/screenshots.html
Post Reply