Examers.io
ExamsOrganizationsHow it worksPricingHelp & FAQ
GIAC (SANS) logo

GIAC Python Coder

Domain 2Objective 2

Regular Expressions GPYC Practice Questions (Page 2)

Part of the Scripting and Automation domain, which makes up ~23% of our current practice bank. GIAC (SANS) does not publish an official question count, but from its 120-minute exam (~50–80 total, ~12–18 in this domain), expect 4–6 from this objective — we provide 16 practice questions to prepare you well beyond it. (estimate)

16questions here
4free pages
8concepts

Questions 6–10

  1. 6foundation · easy

    What is the primary benefit of using re.compile() before performing multiple searches with the same pattern?

    Select an answer first
  2. 7expert · medium

    A developer is using a regex to parse a large log file. The pattern r'\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}' is used to match timestamps. The log file has millions of lines, and the script is running slowly. Which optimization is most likely to improve performance?

    Select an answer first
  3. 8application · medium

    A developer is using re.sub to replace all occurrences of a pattern in a string. The pattern is r'<.*>' and the replacement is 'X'. The input is '<a> <b> <c>'. What will be the output?

    Select an answer first
  4. 9expert · hard

    A security tool is using the pattern `^(a+)+$` to validate usernames. On a long string of 'a' characters followed by '!', the tool hangs. What is the most effective fix?

    Select an answer first
  5. 10foundation · easy

    What is the difference between the greedy quantifier '.*' and the lazy quantifier '.*?'?

    Select an answer first
Finished these 5 questions?

Review the revealed explanations, or continue through the curriculum.

Free Basic Practice is a study aid with revealable answers — not a scored exam. Examers.io is independent and not affiliated with or endorsed by GIAC (SANS). “GPYC” is a trademark of its owner, used for identification only.