Movatterモバイル変換


[0]ホーム

URL:


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

Greedy and lazy quantifiers#450

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation

SamGreenberg
Copy link
Contributor

No description provided.

@SamGreenbergSamGreenberg marked this pull request as draftJanuary 26, 2023 20:46
@dolgachiodolgachio self-requested a reviewJune 5, 2023 10:37
@dolgachiodolgachio added the in progressTranslation in progress labelJun 5, 2023
@dolgachio
Copy link
Collaborator

@SamGreenberg Підкажіть будь ласка, чи актуальний статусDraft для цього пулл реквеста?

@dolgachiodolgachio removed the in progressTranslation in progress labelAug 7, 2023
@SamGreenbergSamGreenberg marked this pull request as ready for reviewAugust 14, 2023 14:38
@SamGreenbergSamGreenberg changed the titleDraft: Greedy and lazy quantifiersGreedy and lazy quantifiersAug 14, 2023
@SamGreenberg
Copy link
ContributorAuthor

@stas-dolgachov draft більше не актуальний

dolgachio reacted with heart emoji

Copy link
Collaborator

@dolgachiodolgachio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Дякую, за чудовий переклад! Я зараз зроблю кілька невеличких правок і прийму його


As we've seen, the lazy mode is not a "panacea" from the greedy search. An alternative is a "fine-tuned" greedy search, with exclusions, as in the pattern `pattern:"[^"]+"`.
Як бачимо, лінивий режим не є "панацеєю" від жадібного пошуку. Як альтернативу розглядають "добре налаштований" жадібний пошук, з виключенням, як в патерні `pattern:"[^"]+"`.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Suggested change
Як бачимо, лінивий режим не є "панацеєю" від жадібного пошуку. Як альтернативу розглядають "добре налаштований" жадібний пошук, з виключенням, як впатерні`pattern:"[^"]+"`.
Як бачимо, лінивий режим не є "панацеєю" від жадібного пошуку. Як альтернативу розглядають "добре налаштований" жадібний пошук, з виключенням, як вшаблоні`pattern:"[^"]+"`.

2. Then it looks for `pattern:.*?`: takes one character (lazily!), check if there's a match for `pattern:" class="doc">` (none).
3. Then takes another character into `pattern:.*?`, and so on... until it finally reaches `match:" class="doc">`.
1. Спочатку, регулярний вираз знаходить початок посилання `match:<a href="`.
2. Далі, він шукає `pattern:.*?`: бере один символ (ліниво!), перевіряє наявність збігу для `pattern:" class="doc">` (нема).
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Suggested change
2. Далі, він шукає`pattern:.*?`: бере один символ (ліниво!), перевіряє наявність збігу для`pattern:">` (нема).
2. Далі, він шукає`pattern:.*?`: бере один символ (ліниво!), перевіряє наявність збігу для`pattern:">` (немає).

Lazy
:Enabled by the question mark`pattern:?`after the quantifier. The regexp engine tries to match the rest of the pattern before each repetition of the quantified character.
Лінивий
:Включається знаком питання`pattern:?`після квантифікатору. Рушій намагається знайти збіг решти патерну перед кожним повторенням квантифікованого символу.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Suggested change
: Включається знаком питання`pattern:?` після квантифікатору. Рушій намагається знайти збіг рештипатерну перед кожним повторенням квантифікованого символу.
: Включається знаком питання`pattern:?` після квантифікатору. Рушій намагається знайти збіг рештишаблону перед кожним повторенням квантифікованого символу.

@dolgachiodolgachio merged commit50370dd intojavascript-tutorial:masterAug 22, 2023
@javascript-translate-bot
Copy link
Contributor

Thank you 💖 I updated the Progress Issue#1 🎉 🎉 🎉

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@dolgachiodolgachiodolgachio approved these changes

Assignees
No one assigned
Labels
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

3 participants
@SamGreenberg@dolgachio@javascript-translate-bot

[8]ページ先頭

©2009-2025 Movatter.jp