Jump to content

Working out preg_match


rockinaway

Recommended Posts

rockinaway,

 

I just went through the same confusion yesterday.

(Im still confused but until I do it over and over - well....)

 

This link http://www.phpfreaks.com/tutorials/52/0.php posted in the resources sticky helped me alot (Along with effigy many thanks).

I read the first page over and over it it breaks it down pretty easy to understand.

 

The best line is on the first page that says

The best way to understand regex is to say it to yourself the way I have written it for you, in a sentence. "match anything with any text ending with any extension", and so forth.

 

I blew right over it the first time through because I didnt understand.

But once I read what each symbol meant then it became a little less cloudy.

 

I would start on page 1

Read it over and over learning the meanings of each symbol and then do like the quote says.

Then write some things out that you would want to do and come up with the expression to go along with it.

I found this to test and it helped alot also

http://regexlib.com/RETester.aspx

 

Just an idea, but that seemed to work for me.

Like I said, Im still a little confused but not as much.

 

Good luck.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.