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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.