https://kotlinlang.org logo
#advent-of-code
Title
# advent-of-code
k

karelpeeters

12/09/2017, 11:37 AM
Today was bit easy again when you use a reluctant regex modifier for the garbage.
s

stkent

12/09/2017, 2:55 PM
What do you mean by "reluctant regex modifier", exactly? Is that indicated by the
?
in
<.*?>
?
k

karelpeeters

12/09/2017, 3:09 PM
Yup! Normally
*
is greedy, meaning it takes as much of the input as possible, and that would be problematic in a string like
"{<abc>}<abc>"
. Using
*?
makes it take as little of the input as possible.
s

stkent

12/10/2017, 11:20 PM
Nice, thanks!
7 Views