[MDEV-20064] regexp_replace + not greedy Created: 2019-07-15 Updated: 2019-07-15 Resolved: 2019-07-15 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | OTHER |
| Affects Version/s: | 10.0.28 |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Major |
| Reporter: | Dag Nygren | Assignee: | Sergei Golubchik |
| Resolution: | Not a Bug | Votes: | 0 |
| Labels: | None | ||
| Environment: |
fedora fc23 mariadb |
||
| Description |
|
The expression:
Should return "12", but now returns "2" (as in ungreedy eval.) |
| Comments |
| Comment by Dag Nygren [ 2019-07-15 ] | ||||
|
Also tested with a fresher Mariadb 10.2.19 and the same error is still there. | ||||
| Comment by Sergei Golubchik [ 2019-07-15 ] | ||||
|
For comparison:
It is greedy, and the greedy .* eats up as much as it can. If you do it non-greedy regexp, it'd do what you want:
| ||||
| Comment by Dag Nygren [ 2019-07-15 ] | ||||
|
Ahh. You are so right! Was focusing too much on the group. This can be closed. Sorry for the noise! |