---
title: "Jam 03 - All"
tags:
- 3 🧪 in testing
- 4 🥳 done
- jam03
- debugging
- regex
- refactoring
---
<!-- markdownlint-disable line-length single-h1 no-inline-html -->
<!-- markdownlint-configure-file { "ul-indent": { "indent": 4 }, "link-fragments": {"ignore_case": true} } -->
# Jam 03 - Regular Expressions: From Debug to Design
{%hackmd dJZ5TulxSDKme-3fSY4Lbw %}
:::spoiler **Course Development Team**
<center>
<table width="100%">
<tr align="center">
<td width="50%">
<img src="https://www.dropbox.com/scl/fi/uz9dn7vc9y5k43160pdb0/Fun-Artsy-Square.png?rlkey=2zmgqgblwsagukfsb343tl3ye&raw=1" alt="Lily Romano" width="100" style="border-radius: 50%"/><br/>
<a href="https://lilyromano.com">Lily Romano</a>
</td>
<td width="50%">
<img src="https://www.bucknell.edu/sites/default/files/styles/faculty_page_photo/public/libris/C00001GOQFVeT0YE/G0000hRJySpIobZY/20160419-7C8A4469.jpg" alt="Brian King" width="100" style="border-radius: 50%"/><br/>
<a href="https://www.bucknell.edu/fac-staff/brian-king">Brian King</a>
</td>
</tr>
</table>
</center>
:::
| | |
| ---------------------- | ------------------------------ |
| **Working Directory:** | `src/main/java/jam03` |
| **Points:** | 10 pts |
| **Team-based?** | NO (but discussion encouraged) |
| **Due:** | Monday, 2025-Feb-13 @ 11:59 pm |
# Objectives
- Master regular expressions for pattern matching, validation, and text processing
- Apply scientific debugging principles using print statements and the debugger
- Practice code organization through method extraction and refactoring
- Build a complete program that combines regex, debugging, and good design
# Introduction & Outcomes
In this lab, you'll learn how regular expressions can be powerful tools for both input validation and debugging. You'll start by learning regex fundamentals, then use them to analyze program output and debug issues. Finally, you'll apply these skills along with good design practices to build a base-3 number converter.
## What You'll Learn & Accomplish
1. **Regular Expression Fundamentals**
- Master pattern matching syntax and concepts
- Create patterns for validation and extraction
- Test patterns using regex101.com
- **Outcome**: Create and validate patterns for phone numbers, emails, and timestamps
2. **Scientific Debugging**
- Use print debugging for quick insights
- Master the IntelliJ debugger
- Apply the scientific method to problem-solving
- Compare debugging approaches
- **Outcome**: Debug complex pattern matching behavior using multiple techniques
3. **Code Organization and Refactoring**
- Extract methods for better organization
- Apply the single responsibility principle
- Improve code maintainability
- Test after each refactoring
- **Outcome**: Build a log analyzer with clean, well-organized code
4. **Practical Application**
- Combine regex and debugging skills
- Implement iterative development
- Create robust input validation
- Design clear user interactions
- **Outcome**: Build a complete base-3 converter that validates input and handles errors gracefully
<!-- Embeds Jam03-Checklist.md -->
{%hackmd rOmnEuaXS_WEYVvnkmX0AA %}
# Getting Started
Before diving into the exercises, let's set up our workspace:
1. Open IntelliJ
2. Create a directory `jam03` under `src/main/java`
3. Create a new file called `answers.txt` in your `jam03` directory
<!-- Embeds Jam02-Exercise1.md -->
{%hackmd 9KZ9RNybQDeZvyPVMyk2JQ %}
<!-- Embeds Jam02-Exercise2.md -->
{%hackmd xMav1K5jReOHIysXxftHMQ %}
<!-- Embeds Jam02-Exercise3.md -->
{%hackmd YCrMVVFSTH2t-BbAFjBwVw %}
<!-- Embeds Jam02-Exercise4.md -->
{%hackmd Vi5azNdTTta2q8gKr_zy4Q %}
<!-- Embeds Jam02-Exercise5.md -->
{%hackmd 62OQ-rqFQAqUHqEjfiz6Mw %}
<!-- Embeds Jam02-Submission.md -->
{%hackmd A8lp_dwHRk6qwskIa6LG5g %}