extension * and extension array declaration
- Behavior of ""*
Behavior of "*" has expanded. Now it can mean the absence of characters, as well as prefixes and endings. This is more convenient than combing these options. In regular expressions with an asterisk, '(. +?)' was replaced with '(. *?)' handling different variants. (If an asterisk is written with a word, endings / prefixes may change. There may also be no prefixes. When an asterisk is at the beginning of a line with a space, there may or may not be a word. Asterisk at the end of a line after a space will also work. New functionality is placed into the 'asterisk_processing' function. Tests are added into the 'tests' directory for all cases.
Examples: 1.1.
- i am from rus*
Are you from Russia? This will work for "I am from Russia" or "I am from RussiaFederation" etc.
1.2.
- i am from *lia
1.3.
- hello my * *friend
I love you, my
- [] syntax
When creating arrays, we've added [] syntax. Square brackets mean that a phrase can contain either a word within those brackets, or the absence of a word. We achieved this with a specific regex that replaces square brackets.
Examples:
1.1. ! array hi = hi|[hello] hi|welcome
- (@hi)
Hi Hi! This will work for "welcome" or "Hello, Hi" etc.