Skip to content

Feature request: RegEx-based substitution for property values #9

@dimayan4enko

Description

@dimayan4enko

Hi,
Thank you for this plugin — I'm happy that someone finally built this functionality.

I’d like to suggest a feature related to working with property values in conditional rules.

Feature request

It would be very useful to be able to take the value of a property and apply a RegEx substitution to it before using it inside a conditional rule.

Right now, conditions based on properties work well, but there’s no way to:

  • access the value of another property, and
  • modify that value (for example, clean it up) using RegEx.

Why this matters

In practice, property values are often not ready to use as-is.
They usually need some transformation.

Example note:

---
tag: website
url: https://google.com
---

There is a rule that applies when tag == website and sets the filename to:

(website) google.com

Here, google.com is derived from the url property.
To get this result, the plugin would need to:

  1. Read the value of url
  2. Remove the protocol using RegEx (for example ^https?://)
  3. Use the cleaned value

Expected behavior

Given this YAML:

---
tag: website
url: https://google.com
---

It should be possible to reference the property value with a RegEx-based substitution, conceptually something like:

{property:url | regex:^https?:// -> ""}

Which would produce:

(website) google.com

The exact syntax is not important.
The key point is being able to apply a RegEx transformation to a property value before inserting it.

Thanks again for maintaining this plugin. This feature would make it much more flexible in everyday use.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions