Jump to content

what is this expression do?


bilis_money

Recommended Posts

Splitting it:

"/" is the starting delimiter
"userfile_" matchs the string "userfile_" (literal)
"[1-5]" is a character class, numbers from 1 to 5
"{1}" is a quantifier (1 time)
"/" is the ending delimiter

It will match userfile_1, userfile_2, userfile_3, userfile_4, and userfile_5.

But since there are no anchors (^ and $) this means it will also match strings with anything before and after it.
Link to comment
Share on other sites

Buy a copy of Programming PHP first version(don't know about the second), from a company called oreilly, by the time you read through there 2-3 pages on regex, you will understand fully all of the basics of regex, until you get down to themore involved stuff, you won't be able to make your own at that point, but atleast you will know what you are reading, and have quick references, you can look up anything under there regex, perl compatible, and post ex
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.