updated to use beregex
updated to use beregex