I got a problem using Rexexp in Java. The example code writes out ABC_012_suffix_suffix
, I was expecting it to output ABC_012_suffix
Probably .*
gives you "full match" and then reduces match to the "empty match" (but still a match). Try (.+)
or (^.*$)
instead. Both work as expected.
At regexinfo star is defined as follows:
*(star) - Repeats the previous item zero or more times. Greedy, so as many items as possible will be matched before trying permutations with less matches of the preceding item, up to the point where the preceding item is not matched at all.