StackStorm / StackStorm/st2

Cannot use regex_match in select

Open
#3,714 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

stale status:to be verified
Dominant language
Python
Stars
6.5k
Forks
787
PR merge metrics
No merged PRs in 30d

Description

I'm trying to do:

{{ list_of_strings | select('regex_match', something + 'somethingelse') }}

To avoid needing another task doing just:

echo '{{ list_of_strings }}' | grep '{{ something + 'somethingelse' }}'

But I'm told:

no test named 'regex_match'

Is that because regex_match is defined as a filter and not as a test ?

I couldn't find a way to use:

{{ list_of_strings | select('in', something + 'somethingelse') }}

To work either, is this expected to work ?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing how select resolves named tests, then inspect the registration and behavior of regex_match and in. Reproduce the two template examples with a minimal input and determine whether the expected result is supported; done means the behavior is fixed or clearly documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.