Welcome to ExamTopics
ExamTopics Logo
- Expert Verified, Online, Free.

Unlimited Access

Get Unlimited Contributor Access to the all ExamTopics Exams!
Take advantage of PDF Files for 1000+ Exams along with community discussions and pass IT Certification Exams Easily.

Exam GPYC topic 1 question 17 discussion

Actual exam question from GIAC's GPYC
Question #: 17
Topic #: 1
[All GPYC Questions]

Which python regular expression method should be used to match any character in a-z, 0-9, or !@#$%^&*()?

  • A. \W
  • B. Greedy matching
  • C. A custom character set
  • D. \w
Show Suggested Answer Hide Answer
Suggested Answer: D 🗳️

Comments

Chosen Answer:
This is a voting comment (?) , you can switch to a simple comment.
Switch to a voting comment New
a29dc2c
2 months, 1 week ago
C. A custom character set
upvoted 1 times
...
JoeSmo
5 months, 2 weeks ago
A custom character set >>> re.findall( r'[0-9!@#$%^&*()].*?', 'abcdeforghitjrkfgn0129374856ABCDKRF*!&@&#$^()' ) ['0', '1', '2', '9', '3', '7', '4', '8', '5', '6', '*', '!', '&', '@', '&', '#', '$', '^', '(', ')']
upvoted 2 times
...
digitreal
6 months, 3 weeks ago
I went with Greedy matching, but who knows I'm not a site that is specifically providing answers.
upvoted 1 times
...
k4zi
8 months, 3 weeks ago
Neither \w or \W would work in this case. A custom set would probably be the way to go. \S would likely work granted spaces were to be excluded.
upvoted 1 times
...
block933
2 years, 7 months ago
Not sure a-z, 0-9 will match on \w but for special characters you need \W
upvoted 1 times
kabwitte
2 years, 5 months ago
I'll go greedy on this one. It matches any character. So, it covers both w and W
upvoted 1 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 ...