Replies: 5 comments 7 replies
-
Yes (for the reasons described above)
I think we should aim to be as complete as possible in having the docs provide answers to any questions that developers might have.
Given that at https://test262.report/browse/built-ins/RegExp we have results for all browserJS engines for a relatively comprehensive test suite, it seems all the compat data we’d need to draw from is readily available? |
Beta Was this translation helpful? Give feedback.
-
I'm sympathetic to the issue here but there are questions, mostly: where would they live, what structure would they have, and how would they relate to the existing docs in the JS reference? We want docs in reference (in JS, CSS, and everywhere else) to be very consistently organized, to make it easier for people to find things. (As you say, the model for reference is "look up") So we have this implicit idea that a set of reference docs consists of pages of different types, that have a consistent relationship with each other. For example, https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp is a page describing a JS global object, like the I've been working on a project to formalize this for MDN: mdn/content#15539. But a page like https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions/Assertions doesn't seem to be any of these things. Where should it live, then, and how should it be navigable from pages like https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp, and do we want to implement special cases just for this? |
Beta Was this translation helpful? Give feedback.
-
Reviving the thread a bit—I've tentatively decided on 16 pages to be created:
(These are page titles, literally) Some pages may be longer than others (e.g. there could be a lot to talk about for backreferences, lookarounds, etc., less so for wildcard or character classes), but generally I expect them to be short—around the length between |
Beta Was this translation helpful? Give feedback.
-
PR's in: mdn/content#22210 just a few incomplete pages. Welcoming feedback. |
Beta Was this translation helpful? Give feedback.
-
Puede alguien ayudarme porfavor |
Beta Was this translation helpful? Give feedback.
-
I want to discuss about the possibility of moving RegExp grammar from "guide" to "reference". Namely, these pages:
This was mostly based on my own experience prior to being familiar with MDN's site structure. Every time I want to look up something (e.g. "lookbehind"), I go to the "Reference" sidebar—but I was never able to find the RegExp grammar section. Sometimes I randomly arrive at a page via search, but I was never able to discover them independently. Only lately did I discover that they are subpages of the Regular expression guide: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions
I have a habit of not reading guides, because guides, which sound like tutorials, often spend time introducing basic concepts while I just want to look up a particular language feature. I have always assumed the reference section contains all language features, and the guide is just a more approachable re-organization of these points. However, for RegExps, there's absolutely no mention of their grammar in the reference section.
One problem this brings about is the lack of browser compatibility table for RegExp grammars. For example, it's not known which browsers support lookbehinds
/(?<a)b/
—Safari doesn't support that to this day, and it had been a footgun for me in the past. Sure, this data isn't present in BCD atm; but even if it is, we have the tradition of not having browser compat tables in the guide section, so they would be weird to appear there. We need a reference page just for the purpose of presenting browser compat.In addition, the flags are still underdocumented. It's not clear how the
multiline
orunicode
flags work in tandem with various regex features, or howglobal
andsticky
impactexec()
. mdn/content#19540 will bring some improvements, but I wish there's a central place to document how flags interact with regex's interpretation and execution.My questions are:
cc @queengooborg @mdn/yari-content-javascript
Beta Was this translation helpful? Give feedback.
All reactions