Skip to content

Instantly share code, notes, and snippets.

@candraKriswinarto
Created December 7, 2022 14:40
Show Gist options
  • Save candraKriswinarto/b397cf5c503e6f7969b5784a2840293c to your computer and use it in GitHub Desktop.
Save candraKriswinarto/b397cf5c503e6f7969b5784a2840293c to your computer and use it in GitHub Desktop.
export const addErrorIntoField = (errors) => errors ? { error: true } : { error: false };
export const phoneRegExp = /^(\+?\d{0,4})?\s?-?\s?(\(?\d{3}\)?)\s?-?\s?(\(?\d{3}\)?)\s?-?\s?(\(?\d{4}\)?)?$/;
export const pawdRegExp = /^(?=.*[A-Za-z])(?=.*\d)(?=.*[@$!%*#?&])[A-Za-z\d@$!%*#?&]{8,}$/;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment