Joke Collection Website - Blessing messages - Problems of $ and $ in JS regularization

Problems of $ and $ in JS regularization

Generally speaking, "0" in regularization means the beginning and $ means the end.

For example, a string matched by \ d+$ can only be a number, because it starts and ends with a number, so it can only match: 1, 12, 123 ... and so on.

\d+$ This matches the number at the end: for example, abc 123.

\ d+ Match the first number, for example: 123abc.

As for when to use it, it depends on your own needs.