What string will match the regular expression (^$)|(^.*\{count\}.*$)n?

  softwareengineering

I’m trying to pass a parameter to create a thumbnail in AWS Elastic transcoder, which shouldn’t be that difficult except I know nothing about regular expressions.

My log is giving me the following error:

Member must satisfy regular expression pattern: (^$)|(^.*\{count\}.*$)n

I just need to specify something called ‘count’ in order for the thumbnail to be created.

This is javascript by the way, if that matters.

Here is the documentation for the parameter:

If you do want Elastic Transcoder to create thumbnails, specify the information that you want to include in the file name for each thumbnail. You can specify the following values in any sequence:

  • {count} (Required): If you want to create thumbnails, you must include {count} in the ThumbnailPattern object. Wherever you specify {count}, Elastic Transcoder adds a five-digit sequence number (beginning with 00001) to thumbnail file names. The number indicates where a given thumbnail appears in the sequence of thumbnails for a transcoded file. If you specify a literal value and/or {resolution} but you omit {count}, Elastic Transcoder returns a validation error and does not create the job.

  • Literal values (Optional): You can specify literal values anywhere in the ThumbnailPattern object. For example, you can include them as a file name prefix or as a delimiter between {resolution} and {count}.

  • {resolution} (Optional): If you want Elastic Transcoder to include the resolution in the file name, include {resolution} in the ThumbnailPattern object.

What would be a valid string specifying ‘count’?

I greatly appreciate any help.

2

See https://regex101.com/r/x2lqg0/4 for an explanation of the regex. It matches any string containing the characters {count}*

You probably want to specify something like this:

thumb{count}

which should produce filenames like

thumb00001.jpg
thumb00002.jpg

and so on.

*(plus some escape characters which are probably not relevant)

LEAVE A COMMENT