exam questions

Exam CAS-004 All Questions

View all questions & answers for the CAS-004 exam

Exam CAS-004 topic 1 question 476 discussion

Actual exam question from CompTIA's CAS-004
Question #: 476
Topic #: 1
[All CAS-004 Questions]

A security analyst is reviewing a new IOC in which data is injected into an online process. The IOC shows the data injection could happen in the following ways:

• Five numerical digits followed by a dash, followed by four numerical digits; or
• Five numerical digits

When one of these IOCs is identified. the online process stops working. Which of the following regular expressions should be implemented in the NIPS?

  • A. ^\d{4}(-\d{5})?$
  • B. ^\d{5}(-\d{4})?$
  • C. ^\d{5-4}$
  • D. ^\d{9}$
Show Suggested Answer Hide Answer
Suggested Answer: B 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
MacherGaming
Highly Voted 1 year ago
Selected Answer: B
B - ^\d{5}(-\d{4})?$: Spend a few hours on https://regex101[.]com/ if you don't already know it. ^ - position at the start of the line \d - matches any digit [0-9] {5} - matches the previous token 5 times (in this case '\d' or any digit) ( ....)? - Capture group, includes a match on the first token (our 5 digits) and what's inside the (...). -\d{4} - a dash "-" followed by any 4 digits $ - position at the end of a line
upvoted 5 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...