Fix of incorrect preg

With the move from ereg to preg functions, two incorrect usages were introduced which cause problem when adding and editing records. Here's a fix for that.