Greetings, I've been working on creating some new policy rules that will require regular expression matching on path names. As a crutch to help me along, I've used the mmfind command to do some searches and used its policy output as a model. Interestingly, it creates REGEX() functions with an undocumented parameter. For example, the following REGEX expression was created in the WHERE clause by mmfind when searching for a pathname pattern: REGEX(PATH_NAME, '*/xy_survey_*/name/*.tif','f') The Scale policy documentation for REGEX only mentions 2 parameters, not 3: REGEX(String,'Pattern') Returns TRUE if the pattern matches, FALSE if it does not. Pattern is a Posix extended regular expression. (The above is from https://www.ibm.com/support/knowledgecenter/STXKQY_5.0.2/com.ibm.spectrum.sc... <https://www.ibm.com/support/knowledgecenter/STXKQY_5.0.2/com.ibm.spectrum.sc...>) Anyone know what that 3rd parameter is, what values are allowed there, and what they mean? My assumption is that it's some sort of selector for type of pattern matching engine, because that pattern (2nd parameter) isn't being handled as a standard regex (e.g. the *'s are treated as wildcards, not zero-or-more repeats). -- Todd E. Ruston Information Systems Manager Monterey Bay Aquarium Research Institute (MBARI) 7700 Sandholdt Road, Moss Landing, CA, 95039 Phone 831-775-1997 Fax 831-775-1652 http://www.mbari.org
Looking at the example '*/xy_survey_*/name/*.tif': that's not a "real" (POSIX) regular expression but a use of a much simpler "wildcard pattern" as commonly used in the UNIX shell when matching filenames. So I would assume that the 'f' parameter just mandates that REGEX() must apply "filename matching" rules here instead of POSIX regular expressions. makes sense? -- Peter
On Feb 20, 2020, at 21:43, Todd Ruston <truston@mbari.org> wrote:
Greetings,
I've been working on creating some new policy rules that will require regular expression matching on path names. As a crutch to help me along, I've used the mmfind command to do some searches and used its policy output as a model. Interestingly, it creates REGEX() functions with an undocumented parameter. For example, the following REGEX expression was created in the WHERE clause by mmfind when searching for a pathname pattern:
REGEX(PATH_NAME, '*/xy_survey_*/name/*.tif','f')
The Scale policy documentation for REGEX only mentions 2 parameters, not 3:
REGEX(String,'Pattern') Returns TRUE if the pattern matches, FALSE if it does not. Pattern is a Posix extended regular expression.
(The above is from https://www.ibm.com/support/knowledgecenter/STXKQY_5.0.2/com.ibm.spectrum.sc... <https://www.ibm.com/support/knowledgecenter/STXKQY_5.0.2/com.ibm.spectrum.sc...>)
Anyone know what that 3rd parameter is, what values are allowed there, and what they mean? My assumption is that it's some sort of selector for type of pattern matching engine, because that pattern (2nd parameter) isn't being handled as a standard regex (e.g. the *'s are treated as wildcards, not zero-or-more repeats).
-- Todd E. Ruston Information Systems Manager Monterey Bay Aquarium Research Institute (MBARI) 7700 Sandholdt Road, Moss Landing, CA, 95039 Phone 831-775-1997 Fax 831-775-1652 http://www.mbari.org <http://www.mbari.org/>
_______________________________________________ gpfsug-discuss mailing list gpfsug-discuss at spectrumscale.org http://gpfsug.org/mailman/listinfo/gpfsug-discuss
Sorry, I believe you had nailed it already -- I didn't read carefully to the end.
On Feb 20, 2020, at 23:17, Peter Serocka <peserocka@gmail.com> wrote:
Looking at the example '*/xy_survey_*/name/*.tif': that's not a "real" (POSIX) regular expression but a use of a much simpler "wildcard pattern" as commonly used in the UNIX shell when matching filenames.
So I would assume that the 'f' parameter just mandates that REGEX() must apply "filename matching" rules here instead of POSIX regular expressions.
makes sense?
-- Peter
On Feb 20, 2020, at 21:43, Todd Ruston <truston@mbari.org <mailto:truston@mbari.org>> wrote:
Greetings,
I've been working on creating some new policy rules that will require regular expression matching on path names. As a crutch to help me along, I've used the mmfind command to do some searches and used its policy output as a model. Interestingly, it creates REGEX() functions with an undocumented parameter. For example, the following REGEX expression was created in the WHERE clause by mmfind when searching for a pathname pattern:
REGEX(PATH_NAME, '*/xy_survey_*/name/*.tif','f')
The Scale policy documentation for REGEX only mentions 2 parameters, not 3:
REGEX(String,'Pattern') Returns TRUE if the pattern matches, FALSE if it does not. Pattern is a Posix extended regular expression.
(The above is from https://www.ibm.com/support/knowledgecenter/STXKQY_5.0.2/com.ibm.spectrum.sc... <https://www.ibm.com/support/knowledgecenter/STXKQY_5.0.2/com.ibm.spectrum.sc...>)
Anyone know what that 3rd parameter is, what values are allowed there, and what they mean? My assumption is that it's some sort of selector for type of pattern matching engine, because that pattern (2nd parameter) isn't being handled as a standard regex (e.g. the *'s are treated as wildcards, not zero-or-more repeats).
-- Todd E. Ruston Information Systems Manager Monterey Bay Aquarium Research Institute (MBARI) 7700 Sandholdt Road, Moss Landing, CA, 95039 Phone 831-775-1997 Fax 831-775-1652 http://www.mbari.org <http://www.mbari.org/>
_______________________________________________ gpfsug-discuss mailing list gpfsug-discuss at spectrumscale.org <http://spectrumscale.org/> http://gpfsug.org/mailman/listinfo/gpfsug-discuss <http://gpfsug.org/mailman/listinfo/gpfsug-discuss>
Thanks Peter, and no worries; great minds think alike. ;-) - Todd
On Feb 20, 2020, at 2:25 PM, Peter Serocka <peserocka@gmail.com> wrote:
Sorry, I believe you had nailed it already -- I didn't read carefully to the end.
On Feb 20, 2020, at 23:17, Peter Serocka <peserocka@gmail.com <mailto:peserocka@gmail.com>> wrote:
Looking at the example '*/xy_survey_*/name/*.tif': that's not a "real" (POSIX) regular expression but a use of a much simpler "wildcard pattern" as commonly used in the UNIX shell when matching filenames.
So I would assume that the 'f' parameter just mandates that REGEX() must apply "filename matching" rules here instead of POSIX regular expressions.
makes sense?
-- Peter
On Feb 20, 2020, at 21:43, Todd Ruston <truston@mbari.org <mailto:truston@mbari.org>> wrote:
Greetings,
I've been working on creating some new policy rules that will require regular expression matching on path names. As a crutch to help me along, I've used the mmfind command to do some searches and used its policy output as a model. Interestingly, it creates REGEX() functions with an undocumented parameter. For example, the following REGEX expression was created in the WHERE clause by mmfind when searching for a pathname pattern:
REGEX(PATH_NAME, '*/xy_survey_*/name/*.tif','f')
The Scale policy documentation for REGEX only mentions 2 parameters, not 3:
REGEX(String,'Pattern') Returns TRUE if the pattern matches, FALSE if it does not. Pattern is a Posix extended regular expression.
(The above is from https://www.ibm.com/support/knowledgecenter/STXKQY_5.0.2/com.ibm.spectrum.sc... <https://www.ibm.com/support/knowledgecenter/STXKQY_5.0.2/com.ibm.spectrum.sc...>)
Anyone know what that 3rd parameter is, what values are allowed there, and what they mean? My assumption is that it's some sort of selector for type of pattern matching engine, because that pattern (2nd parameter) isn't being handled as a standard regex (e.g. the *'s are treated as wildcards, not zero-or-more repeats).
-- Todd E. Ruston Information Systems Manager Monterey Bay Aquarium Research Institute (MBARI) 7700 Sandholdt Road, Moss Landing, CA, 95039 Phone 831-775-1997 Fax 831-775-1652 http://www.mbari.org <http://www.mbari.org/>
_______________________________________________ gpfsug-discuss mailing list gpfsug-discuss at spectrumscale.org <http://spectrumscale.org/> http://gpfsug.org/mailman/listinfo/gpfsug-discuss <http://gpfsug.org/mailman/listinfo/gpfsug-discuss>
_______________________________________________ gpfsug-discuss mailing list gpfsug-discuss at spectrumscale.org http://gpfsug.org/mailman/listinfo/gpfsug-discuss
The third option is to specify the flavor of regex desired. Right now, if specified, must be one of these: 'x','b','f', 'ix','ib' 'x' extended regular expressions - the default - as implemented by regcomp and regexec library functions with REG_EXTENDED flag 'b' basic regular expressions - without REG_EXTENDED 'f' glob like pattern matching as implemented by fnmatch library function The three 'i' are similar, except upper/lower case is ignored as implemented by the library function with the ignore case flag or option: REG_ICASE or FNM_CASEFOLD We haven't published this because it is not yet fully tested. Regards, The Spectrum Scale (GPFS) team ------------------------------------------------------------------------------------------------------------------ If you feel that your question can benefit other users of Spectrum Scale (GPFS), then please post it to the public IBM developerWroks Forum at https://www.ibm.com/developerworks/community/forums/html/forum?id=11111111-0.... If your query concerns a potential software error in Spectrum Scale (GPFS) and you have an IBM software maintenance contract please contact 1-800-237-5511 in the United States or your local IBM Service Center in other countries. The forum is informally monitored as time permits and should not be used for priority messages to the Spectrum Scale (GPFS) team. From: Todd Ruston <truston@mbari.org> To: gpfsug main discussion list <gpfsug-discuss@spectrumscale.org> Date: 02/20/2020 03:49 PM Subject: [EXTERNAL] [gpfsug-discuss] Policy REGEX question Sent by: gpfsug-discuss-bounces@spectrumscale.org Greetings, I've been working on creating some new policy rules that will require regular expression matching on path names. As a crutch to help me along, I've used the mmfind command to do some searches and used its policy output as a model. Interestingly, it creates REGEX() functions with an undocumented parameter. For example, the following REGEX expression was created in the WHERE clause by mmfind when searching for a pathname pattern: REGEX(PATH_NAME, '*/xy_survey_*/name/*.tif','f') The Scale policy documentation for REGEX only mentions 2 parameters, not 3: REGEX(String,'Pattern') Returns TRUE if the pattern matches, FALSE if it does not. Pattern is a Posix extended regular expression. (The above is from https://www.ibm.com/support/knowledgecenter/STXKQY_5.0.2/com.ibm.spectrum.sc... ) Anyone know what that 3rd parameter is, what values are allowed there, and what they mean? My assumption is that it's some sort of selector for type of pattern matching engine, because that pattern (2nd parameter) isn't being handled as a standard regex (e.g. the *'s are treated as wildcards, not zero-or-more repeats). -- Todd E. Ruston Information Systems Manager Monterey Bay Aquarium Research Institute (MBARI) 7700 Sandholdt Road, Moss Landing, CA, 95039 Phone 831-775-1997 Fax 831-775-1652 http://www.mbari.org _______________________________________________ gpfsug-discuss mailing list gpfsug-discuss at spectrumscale.org https://urldefense.proofpoint.com/v2/url?u=http-3A__gpfsug.org_mailman_listi...
participants (3)
-
IBM Spectrum Scale -
Peter Serocka -
Todd Ruston
