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

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.