A plugin which adds a shortcode: [gallery_from_regex_matches] in which a regex attribute should be specified. It will then look for matches in the descriptions and titles of all published images in your library, and create a gallery from the matches it finds.
[gallery_from_regex_matches regex="lillill" exclude_ids="764"], and it will generate a gallery of all your pictures of “Lillill”, except the one which has ID 764.limit to the shortcode. [gallery_from_regex_matches regex="lillill" exclude_ids="764" limit="10"].[[:>:]], in this case you can exclude_regex=catsup. Then it could look something along the line of [gallery_from_regex_matches regex="cats" exclude_regex="catsup"].ids) as for the [media] shortcode can be used (as this plugin calls that shortcodes callback function (gallery_shortcode()) to generate the gallery), so if you want to specify a particular type (style) of gallery from for example your cat pictures , this might do the trick: [gallery_from_regex_matches regex="(cat|kitten)" type="square"].Since the regex used by the plugin is specified as an attribute value inside of a shortcode, and the Shortcode Api disallows the use of certain characters which could be a part of a valid, useful regex, there are some things to consider.
Attribute values must never contain the following characters:
* Square braces: [ ]
* Quotes: ” ‘[ … ]
The recommended method of escaping special characters in shortcode attributes is HTML encoding. Most importantly, any user input appearing in a shortcode attribute must be escaped or stripped of special characters.
[a-z], then (following the shortcode Api documentation guidline), they need to be encoded. There are two encodings which the plugin accepts: “html” and “base64” w[0u][0u]ti can be expressed either:With HTML encoding:
[gallery_from_regex_matches regex="w[0u][0u]ti" encoding="html"]
With Base64 encoding:
[gallery_from_regex_matches regex="d1swdV1bMHVddGk=" encoding="base64"]
To encode a string to base64, it can be done from the terminal like this:
% echo -n "catsup" | base64
Y2F0c3Vw
% echo -n Y2F0c3Vw | base64 --decode
catsup%