Skip to content

Exercise 071: Regular Expression Sigil ~r #51

@zoedsoupe

Description

@zoedsoupe

Exercise 071: Regular Expression Sigil ~r

Topic: Sigils
Level: 17
Difficulty: 1

Prerequisites

  • Exercise 005: Strings
  • Basic regex understanding

Learning Objectives

Students will learn to:

  • Create regex with ~r sigil
  • Use Regex.match? and Regex.run
  • Understand regex modifiers

Key Concepts

  • ~r sigil syntax
  • Regex module functions
  • Regex modifiers (i for case-insensitive)

Exercise Structure

  • Explain ~r"pattern" creates compiled regex
  • Show examples with Regex.match?, Regex.run
  • Task: Match string against regex pattern
  • Expected output: Boolean match result

Hints

~r allows regex without double-escaping backslashes

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions