1
mirror of https://github.com/xitanggg/open-resume synced 2025-01-05 08:36:22 +01:00

allow brackets outside phone numbers

This commit is contained in:
Anton Kulikalov 2023-06-30 11:38:24 -04:00 committed by Xitang Zhao
parent 8b5932ec25
commit b9591328ba

View File

@ -26,7 +26,7 @@ const hasAt = (item: TextItem) => item.text.includes("@");
// Simple phone regex that matches (xxx)-xxx-xxxx where () and - are optional, - can also be space
export const matchPhone = (item: TextItem) =>
item.text.match(/\(?\d{3}\)?[\s-]?\d{3}[\s-]?\d{4}/);
const hasParenthesis = (item: TextItem) => /[()]/.test(item.text);
const hasParenthesis = (item: TextItem) => /\([0-9]+\)/.test(item.text);
// Location
// Simple location regex that matches "<City>, <ST>"