Consolidated regex replace loops together

Combined for loop logic so aliases are only looped through once.