This project is my solution to the Regex Onboarding Hackathon Formative Assessment.
It extracts and validates specific data types (Email, URL, Phone, Credit Card, Time, Hashtag, Currency, HTML tags) from strings using JavaScript Regular Expressions.
- Validate emails
- Validate URLs
- Validate phone numbers
- Validate credit card numbers
- Validate time formats (12-hour & 24-hour)
- Validate hashtags
- Clone the repo:
git clone https://github.com/david-ac1/alu_regex-data-extraction-david-ac1.git
- Navigate to the folder: cd alu_regex-data-extraction-david-ac1
- Run the program with your system runtime environment
-
Testing email: user@example.com -> Valid firstname.lastname@company.co.uk -> Valid wrongemail..com -> Invalid
-
Testing url: https://www.example.com -> Valid https://subdomain.example.org/page -> Valid http://regex101.com/tech -> Valid
-
Testing phone: (123) 456-7890 -> Valid 123-456-7890 -> Valid 12-34-567 -> Invalid
-
Testing creditCard: 1234 5678 9012 3456 -> Valid 1234-5678-9012-3456 -> Valid 12345678 -> Invalid
-
Testing time: 14:30 -> Valid 2:30 PM -> Valid 25:99 -> Invalid
-
Testing hashtag: #StraightfromNaija -> Valid #EqualRights -> Valid #DBMS -> Valid