Answered step by step
Verified Expert Solution
Link Copied!

Question

00
1 Approved Answer

Write a regular expression to match SSNs as per the following rules: Assume SSNs do not start with a 0 SSNs can start or end

  1. Write a regular expression to match SSNs as per the following rules:

  1. Assume SSNs do not start with a 0

  1. SSNs can start or end a line or, both

  1. SSNs can be followed or preceded by a whitespace

  1. SSNs can be followed or preceded by the punctuation symbol set: { , . ; : ? ! }

  1. Also, match SSNs of the form xx-xxx-9999 OR XX-XXX-9999, where only the last 4 digits are exposed. For simplicity, assume a string xX-XXXx-9999 will also match
  2. The symbol in the SSNs is optional.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions