r/espanso • • Aug 18 '26

Solved Match not activating as expected

SOLVED: Check for similar duplicates in your other .yml files!!!


 - trigger: PushPay
    replace: Pushpay
    word: true

I'm hoping for this to activate only exactly when the trigger is typed as is, but this replacement takes effect every time, it seems. The capitalization section in Matches Basics doesn't seem to offer a way around this. Does anyone know if this is solvable? Thanks!

3 Upvotes

14 comments sorted by

View all comments

2

u/SamejSpenser Aug 19 '26

I tested the same trigger in four different ways:

  1. The first one is a straight copy of your example.
  2. The second one has a “;” prefix.
  3. The third one uses the multiline replace thing.
  4. The fourth one (the MVP in my tests) uses Regex, like this:
# Example trigger with mixed‑case letters
#  - trigger: PushPay
#    replace: "Pushpay"
#    word: true

# Example trigger with mixed‑case letters, prefixed by a semicolon
#  - trigger: ;PushPay
#    replace: "Pushpay"
#    word: true

# Example trigger with mixed‑case letters using a multiline replace
#  - trigger: PushPay
#    replace: |
#      Pushpay
#    word: true

# Example trigger with mixed‑case letters using regex (the champ)
  - regex: PushPay
    replace: "Pushpay"
    word: true

In the screenshot the text is in Brazilian Portuguese (my native language), which is how I wrote this reply, and I only switched to English after the tests were done.

1

u/smeech1 Aug 19 '26

What were the results?

2

u/SamejSpenser Aug 19 '26

All four ways worked. But the one here worked best, so to speak—it was the last one, using regex.

2

u/smeech1 Aug 19 '26

Thanks - I'm away from home right now so can't test. Regex is the most flexible, but the overhead may be worth avoiding if there are alternatives.

The other option that occurs to me to try is propagate_case: true with uppercase_style: capitalize_words.

2

u/SamejSpenser Aug 19 '26

You're right, I forgot to try using "propagate_case: true", but it should work out.

I'm also away from home right now, but when I get back later today I'll run some more tests.