javascript-tutorial / javascript-tutorial/en.javascript.info

Lack of essential detail about regexp lookbehind syntax in "Lookahead and lookbehind" article

未關閉
#3,297 2 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
主要語言
HTML
星號
25.5k
分支
4k
PR 合併指標
30 天內沒有已合併 PR

描述

[Part 3 (Additional articles)](https://javascript.info/#tab-3)
[Chapter 7 (Regular expressions)](https://javascript.info/regular-expressions)
[Article 14 (Lookahead and lookbehind)](https://javascript.info/regexp-lookahead-lookbehind)

Why you don't mention that in JS non fixed length regexps (including quantifiers, backreferences etc.) are not allowed inside lookbehind expression ?

First you talk about [lookahead](https://javascript.info/regexp-lookahead-lookbehind#lookahead), and using regexp with quantifier as lookahead condition in your example.

_Copied from [www.javascript.info](https://javascript.info)_
For example, `\d+(?=\s)`**`(?=.*30)`** looks for `\d+` that is followed by a space `(?=\s)`, and there’s `30` somewhere after it **`(?=.\*30)`**

Right after this you briefly talk about [lookbehind](https://javascript.info/regexp-lookahead-lookbehind#lookbehind) and say it is the same thing but looks behind, without mentioning that it actually cannot do the same thing with non fixed lenght regular expressions (including quantifiers like **\***).

貢獻指南

這個儲存庫沒有索引到貢獻指南

研究方向

從 issue 中連結的「Lookahead and lookbehind」文章開始,尤其閱讀其中關於 lookahead 和 lookbehind 的部分。將文件中的範例與 JavaScript 對 lookbehind 運算式中非固定長度模式的限制進行比較。完成的標準是文章清楚地說明這項限制,並區分 lookahead 的行為與 lookbehind 的行為。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
javascript
領域
documentation
Issue 類型
文件
難度
1/5
預估耗時
1-3 小時
活躍度
停滯
描述清晰度
描述清楚
新手友好度
38/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。