2

after trying and reading Lua's doc on patterns, I couldn't figure it out.

I am using an OBS plugin to activate a source on text document change, and the plugin uses Lua pattern matching. I would like to trigger the source whenver the document is EMPTY and only empty. How can I go about doing this?

Example, using the non-empty pattern match:

enter image description here

Thank you for any help!

0

1 Answer 1

1

Pattern matching an empty string is

^$

where

  • ^ - matches the start of string position
  • $ - matches the end of string position.

That is, start and end of string positions must be the same position in the string.

Sign up to request clarification or add additional context in comments.

2 Comments

Or simply s == "".
@lhf I understand there is no actual code access from the plugin, only a field that accepts a pattern string.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.