-
Notifications
You must be signed in to change notification settings - Fork 38
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
解析水球的正則表示式的呈現方式問題 #77
Comments
var regex = new RegExp("\x1b\[24;\d{2}H\x1b\[1;37;45m([^\x1b]+)(?:\x1b\[24;18H)?\x1b\[m", "g"); 與原式語義有異。 如欲改以 因此此式應修正為: var regex = new RegExp("\\x1b\\[24;\\d{2}H\\x1b\\[1;37;45m([^\\x1b]+)(?:\\x1b\\[24;18H)?\\x1b\\[m", "g"); 但此寫法不如使用 |
This solves robertabcd#77 Regex literals (codes like `/pattern/flags`) are already instances of RegExp, thus `new RegExp(/pattern/flags)` creates an extra copy of the RegExp object, which is often not intended. This issue is fixed by rewritten `new RegExp()` codes into plain regex literals.
This solves robertabcd#77 Regex literals (codes like `/pattern/flags`) are already instances of RegExp, thus `new RegExp(/pattern/flags)` creates an extra copy of the RegExp object, which is often not intended. This issue was introduced in iamchucky/PttChrome. This issue is fixed by rewritten `new RegExp()` codes into plain regex literals.
This solves robertabcd#77 Regex literals (codes like `/pattern/flags`) are already instances of RegExp, thus `new RegExp(/pattern/flags)` creates an extra copy of the RegExp object, which is often not intended. This issue was introduced in iamchucky/PttChrome. This issue is fixed by rewritten `new RegExp()` codes into plain regex literals.
This solves robertabcd#77 Regex literals (codes like `/pattern/flags`) are already instances of RegExp, thus `new RegExp(/pattern/flags)` creates an extra copy of the RegExp object, which is often not intended. This issue was introduced in iamchucky/PttChrome. This issue is fixed by rewritten `new RegExp()` codes into plain regex literals.
因爲這個正規表達式字面值具有
另外,由於 |
遇到的問題: 純粹程式碼寫法問題
在
parseWaterball
(string_utils.js:L155)[https://github.com/robertabcd/PttChrome/blob/88e3562e6536cc0a91dbbb9f65e59036e4b73b79/src/js/string_util.js#L155]當中的正則表示式
其中如果使用了 new RegExp 的話,那應該就不需要外面以 / 包圍了吧?
也就是應該改成
或是
這樣?
The text was updated successfully, but these errors were encountered: