'#' matches 0-9 one of the numbers.
ex.1)Pattern string = IMG#.jpg
If a URL includes IMG0.jpg
or IMG1.jpg
or ... or IMG8.jpg
or IMG9.jpg
, it is matched.
In the case of http://www.test.com/IMG.jpg
, because a number doesn't come
after "IMG", this URL isn't matched.
ex.2)Pattern string = IMG###.jpg
If a URL includes IMG000.jpg
or IMG001.jpg
or ... or IMG998.jpg
or IMG999.jpg
, it is matched.
In the case of http://www.test.com/IMG0a1.jpg
, because it doesn't include
three consecutive numerical value, this URL isn't matched.
'?' matches with any single character.
ex.1)Pattern string = IMG_?.jpg
If a URL includes the expression that some one character is inserted between
IMG_
and .jpg
, it is matched.
In the case of http://www.test.com/IMG_l.jpg
, this URL is matched.
In the case of http://www.test.com/IMG_00.jpg
,two
characters(00
) are sandwiched between IMG_
snd
.jpg
, it isn't matched.
ex.2)Pattern string = IMG_???.jpg
This pattern matches the URL that some three characters are inserted between between
IMG_
and .jpg
.
'*' matches with any zero or more characters.
ex.)Pattern string = IMG_*.jpg
If a URL includes the expression that some zero or more characters is inserted between
IMG_
and .jpg
, it is matched.
Therefore it matches both of IMG_.jpg
, IMG_000.jpg
and IMG_000abc.jpg
.
'+' matches with any one or more characters.
ex.)Pattern string = IMG_+.jpg
If a URL includes the expression that some one or more characters is inserted between
IMG_
and .jpg
, it is matched.
Therefore it matches both of IMG_.jpg
, IMG_000.jpg
and IMG_000abc.jpg
.
It don't match, if there is nothing between IMG_
and
.jpg
.
Therefore it matches both of IMG_000.jpg
and IMG_000abc.jpg
.
The pattern enclosed in '[]' is treated as a regular expression.
Regular expressions conform to Java specifications.
ex.)[https?://www\.test\.com/IMG_*\.jpg]