Filtering numerics and "^" and "&" options

Author Message
Gerald 10/27/2003 11:56 am
Looking through the OEP help, I noticed an option "^" and "$" in a filtering example (^/mydir/$). Can you expand on it`s intended uses? I think I understand, but had problems getting it to work for me. It may be differences in the way it is interpreted for files, directories, and URLs.

Additionally, is it possible to filter for individual character positions and numerics in the file and directory filters? I tried using the URL examples, but found another area in the help listing it differently. Would the following new way work properly for numerics? What do you use for a single character (i.e. /data?/, where ? indicates any single character)?

Old way for directory exclusion (numeric):

/data/{:0-9}{:0-9}{:0-9}/{:0-9}{:0-9}{:0-9}-{:0-9}{:0-9}{:0-9}{:0-9}-{:0-9}{:0-9}/pdf/

Right way?:

/data/[0-9][0-9][0-9]/[0-9][0-9][0-9]-[0-9][0-9][0-9][0-9]-[0-9][0-9]/pdf/

Thanks,
Gerald
Oleg Chernavin 10/28/2003 07:04 am
> Looking through the OEP help, I noticed an option "^" and "$" in a filtering example (^/mydir/$). Can you expand on it`s intended uses? I think I understand, but had problems getting it to work for me. It may be differences in the way it is interpreted for files, directories, and URLs.

^ symbol indicates that the directory or filename should start from the keyword. $ - means that it should end with the keyword. ^....$ - that it should be exactly as the keyword.

Without these symbols, keyword will match, say, a filename, if it contains the keyword inside (in the beginning, middle or at the end of the filename).

> Additionally, is it possible to filter for individual character positions and numerics in the file and directory filters? I tried using the URL examples, but found another area in the help listing it differently. Would the following new way work properly for numerics? What do you use for a single character (i.e. /data?/, where ? indicates any single character)?

There is no such symbol, because ? is widely used in URLs. You can use * instead, which indicates any number of symbols: /data*/

> /data/{:0-9}{:0-9}{:0-9}/{:0-9}{:0-9}{:0-9}-{:0-9}{:0-9}{:0-9}{:0-9}-{:0-9}{:0-9}/pdf/
>
> Right way?:
>
> /data/[0-9][0-9][0-9]/[0-9][0-9][0-9]-[0-9][0-9][0-9][0-9]-[0-9][0-9]/pdf/

Yes, this one is correct.

Best regards,
Oleg Chernavin
MP Staff