Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

extension * and extension array declaration#150

Open
kuznecovavs96 wants to merge 1 commit into
aichaos:master from
kuznecovavs96:master
Open

extension * and extension array declaration #150
kuznecovavs96 wants to merge 1 commit into
aichaos:master from
kuznecovavs96:master

Conversation

@kuznecovavs96

@kuznecovavs96 kuznecovavs96 commented Nov 22, 2021

Copy link
Copy Markdown
  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.

rdkn and Iskuskov reacted with thumbs up emoji
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /