jmeaster30 / vore

VerbOse Regular Expressions - Regular Expression Engine with Verbose English-like Syntax
MIT License
1 stars 0 forks source link

Add ability to check if a variable exists inline #92

Open jmeaster30 opened 1 year ago

jmeaster30 commented 1 year ago

Currently our variable captures the string value but they can't capture if the match exists or not.

I definitely want this in the replace result (after the with part) but it could be useful to do it right in the variable assignment in the search section.

Maybe use an exists keyword

Could do maybe 'error' exists wasError or something

jmeaster30 commented 9 months ago

In search section <expr> exists <variable> will make <variable> equal to 'true' if <expr> is a non-empty match otherwise it will be 'false'

In replace section <variable> exists <expr> will output <expr> if <variable> exists