Fix collect regex to prevent DOS attacks

@robyoung
@pbadenski