# Square bracket wildcards in \`cylc insert\` cycle points?

**URL:** <https://cylc.discourse.group/t/square-bracket-wildcards-in-cylc-insert-cycle-points/123>\
**Category:** Cylc Support\
**Created:** [August 12, 2019, 2:38am UTC](https://cylc.discourse.group/t/square-bracket-wildcards-in-cylc-insert-cycle-points/123 "2019-08-12T02:38:06Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![jonnyhtw](https://yyz2.discourse-cdn.com/free1/user_avatar/cylc.discourse.group/jonnyhtw/32/232_2.png) [@jonnyhtw](https://cylc.discourse.group/u/jonnyhtw)\
**Post date:** [August 12, 2019, 2:38am UTC](https://cylc.discourse.group/t/square-bracket-wildcards-in-cylc-insert-cycle-points/123/1 "2019-08-12T02:38:06Z")

</div>

Hi there

Should I be able to use `[]` wildcards in `cylc insert` calls?

This works…

```
cylc insert foo py_for_afterburner.19510101T0000Z

```

… but this doesn’t…

```
cylc insert foo py_for_afterburner.195[1-9]0101T0000Z

```

Is this behaviour expected?

Thanks a lot

Jonny

---

<div class="post-metadata">

**Author:** ![hilary.j.oliver](https://yyz2.discourse-cdn.com/free1/user_avatar/cylc.discourse.group/hilary.j.oliver/32/4_2.png) [@hilary.j.oliver](https://cylc.discourse.group/u/hilary.j.oliver)\
**Post date:** [August 12, 2019, 3:46am UTC](https://cylc.discourse.group/t/square-bracket-wildcards-in-cylc-insert-cycle-points/123/2 "2019-08-12T03:46:12Z")

</div>

Hi Jonny,

“Glob” pattern matching works as documented in the command help - including character ranges in task name and cycle point values - _for commands that target existing tasks_ in the task pool.

The `cylc insert` command is different though. Rather than matching and operating on existing tasks, it inserts new tasks into the task pool. So no, you can’t use globbing with `cylc insert` because globs (like regexes) are for matching existing stuff, not for generating all the possible new stuff that the pattern would match.

Unfortunately I see `cylc insert --help` just prints the generic task-matching CLI info though. Sorry about that; I’ll post an issue to get it fixed.

Hilary

---

<div class="post-metadata">

**Author:** ![hilary.j.oliver](https://yyz2.discourse-cdn.com/free1/user_avatar/cylc.discourse.group/hilary.j.oliver/32/4_2.png) [@hilary.j.oliver](https://cylc.discourse.group/u/hilary.j.oliver)\
**Post date:** [August 12, 2019, 3:51am UTC](https://cylc.discourse.group/t/square-bracket-wildcards-in-cylc-insert-cycle-points/123/3 "2019-08-12T03:51:53Z")

</div>

> <https://github.com/cylc/cylc-flow/issues/3284>

---

<div class="post-metadata">

**Author:** ![jonnyhtw](https://yyz2.discourse-cdn.com/free1/user_avatar/cylc.discourse.group/jonnyhtw/32/232_2.png) [@jonnyhtw](https://cylc.discourse.group/u/jonnyhtw)\
**Post date:** [August 12, 2019, 4:03am UTC](https://cylc.discourse.group/t/square-bracket-wildcards-in-cylc-insert-cycle-points/123/4 "2019-08-12T04:03:09Z")

</div>

Hi Hilary

OK got it, thanks. I hadn’t appreciated the difference between the different types of pattern matching.

Thanks for raising the ticket!

Cheers

Jonny

---

<div class="post-metadata">

**Author:** ![hilary.j.oliver](https://yyz2.discourse-cdn.com/free1/user_avatar/cylc.discourse.group/hilary.j.oliver/32/4_2.png) [@hilary.j.oliver](https://cylc.discourse.group/u/hilary.j.oliver)\
**Post date:** [August 12, 2019, 9:36pm UTC](https://cylc.discourse.group/t/square-bracket-wildcards-in-cylc-insert-cycle-points/123/5 "2019-08-12T21:36:30Z")

</div>

Slight correction (thanks @matthewrmshin and @dwsutherland):

You **can** do globbing of task names with `cylc insert`, because they can match against the list of all known task names in the suite.

(But you **can’t** do globbing of cycle points with `cylc insert` because the server program does not know “all the possible cycle points” to match against (they could be infinite!) - they are generated dynamically (and incrementally) from the graph recurrence expressions as the suite runs.)

(But\_2 other task-targeting commands such as `cylc trigger` **can** do globbing of both task name and cycle points, because they match against task proxies - `name.cycle-point` - present in the current task pool).

Hilary
