Please explain the difference between .+ And .* . In my opinion, both of them should "display, find or underline" all the text given in the file. When I write to regexr.com .+ It finds all the text, but when I write the expression .* Then the infinite error is displayed.

PS Flag global activated

  • Request to the studio! . + this is at least one. * - incl. nothing. Sometimes there is a recursion, if there are attachments of patterns ... - DNS

1 answer 1

.+ - any character (s) in the amount of 1 or more. .* - any character (s) in the amount of 0 or more. The second expression matches absolutely any text, including the empty string, 1 - any string, except the empty one.

In python, the expression .* Compiles normally, and really matches any string.

  • Yes, and on Apache .* Does not cause problems - DNS