◐ Shell
reader mode source ↗
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
File filter
Conversations
Jump to
Diff view
Apply and reload
Show whitespace
Diff view
Apply and reload
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

The result is: `match:123 4`.

First the lazy `pattern:\d+?` tries to take as little digits as it can, but it has to reach the space, so it takes `match:123`.

Then the second `\d+?` takes only one digit, because that's enough.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# A match for /d+? d+?/

What's the match here?

```js
alert( "123 456".match(/\d+? \d+?/g) ); // ?
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# Find HTML tags

Create a regular expression to find all (opening and closing) HTML tags with their attributes.

An example of use:

```js run
let regexp = /your regexp/g;

let str = '<> <a href="/"> <input type="radio" checked> <b>';

alert( str.match(regexp) ); // '<a href="/">', '<input type="radio" checked>', '<b>'
```

Here we assume that tag attributes may not contain `<` and `>` (inside quotes too), that simplifies things a bit.
Loading
Toggle all file notes Toggle all file annotations