firasdib / Regex101

This repository is currently only used for issue tracking for www.regex101.com
3.26k stars 199 forks source link

wrong match in Java regex #2025

Closed panda-on closed 1 year ago

panda-on commented 1 year ago

Quiz Bug

Bug Description

the following regex "(dt)?+.+" in Java should match any strings except "dt", but it turns out matched "dt" on the web page;

Reproduction steps

use the preceding regex in Java, will get the result.

Expected Outcome

If input "dt", "dts", "flower", the matched output string are "dts","flower"

Browser

Include browser name and version

OS

Edge 111.0.1661.51

working-name commented 1 year ago

https://regex101.com/r/LojuWO/1

https://onecompiler.com/java/3z3t3j5hs

firasdib commented 1 year ago

Works as expected