Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

extension * and extension array declaration #150

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kuznecovavs96
Copy link

  1. 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

== brasi => Are you from Brasilia?
Are you from big city?
This will work for "I am from Brasilia" or "I am from Sicilia" etc.

1.3.

  • hello my * *friend

I love you, my !
This will work for "Hello my best friend" or "Hello my best best friend" or "Hello my best little bestfriend" or "Hello my friend" etc.

  1. [] 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!
This will work for "welcome" or "Hello, Hi" etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants