Back
Syntax
Study
Editor
Mode:
HTML
CSS
JavaScript
PHP
Reset
Run »
HTML / CSS / JS
// Numbered groups const date = "2024-06-15"; const match = date.match(/(\d{4})-(\d{2})-(\d{2})/); // match[1] = "2024", match[2] = "06", match[3] = "15" // Named groups const named = date.match(/(?<year>\d{4})-(?<month>\d{2})-(?<day>\d{2})/); const { year, month, day } = named.groups; // Non-capturing group (?:...) /(?:https?):\/\//.test("https://"); // Groups but does not capture
Result
Open