Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .claude/settings.local.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,11 @@
"Bash(powershell:*)",
"Bash(rustc --version)",
"Bash(git config:*)",
"Bash(../target/release/wfl.exe pattern.wfl)"
"Bash(../target/release/wfl.exe pattern.wfl)",
"Bash(git fetch --all --prune)",
"Bash(git merge --no-ff:*)",
"Bash(git add -A)",
"Bash(git commit -m \"wfl-ai: *\")"
],
"deny": []
}
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

98 changes: 98 additions & 0 deletions Docs/api/wfl-standard-library.md
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,104 @@ Replaces pattern matches in text.
- **Returns**: Text
- **Example**: `store cleaned as pattern.replace(pattern, text, "")`

### Pre-built Patterns

WFL provides commonly used patterns in the standard library for validation and parsing tasks:

#### `email_pattern`
Validates email addresses according to RFC 5322 standards.
- **Type**: Pattern
- **Usage**: `if user_email matches email_pattern:`
- **Example**:
```wfl
store user_input as "user@example.com"
if user_input matches email_pattern:
display "Valid email address"
end if
```

#### `url_pattern`
Matches HTTP and HTTPS URLs with optional ports and paths.
- **Type**: Pattern
- **Matches**: `http://`, `https://` URLs with domains, ports, and paths
- **Example**:
```wfl
store link as "https://example.com:8080/path?query=value"
if link matches url_pattern:
display "Valid URL"
end if
```

#### `phone_pattern`
Matches common phone number formats including US/Canada formats.
- **Type**: Pattern
- **Formats**: (XXX) XXX-XXXX, XXX-XXX-XXXX, XXX.XXX.XXXX
- **Example**:
```wfl
store phone as "555-123-4567"
store result as find phone_pattern in phone
if result is not nothing:
display "Phone: " with result.match
end if
```

#### `ipv4_pattern`
Matches IPv4 addresses (0.0.0.0 to 255.255.255.255).
- **Type**: Pattern
- **Example**:
```wfl
store server_ip as "192.168.1.100"
if server_ip matches ipv4_pattern:
display "Valid IPv4 address"
end if
```

#### `ipv6_pattern`
Matches IPv6 addresses in standard and compressed formats.
- **Type**: Pattern
- **Formats**: Full, compressed (::), and mixed IPv6 formats
- **Example**:
```wfl
store ipv6_addr as "2001:0db8:85a3::8a2e:0370:7334"
if ipv6_addr matches ipv6_pattern:
display "Valid IPv6 address"
end if
```

#### `date_pattern`
Matches common date formats (YYYY-MM-DD, MM/DD/YYYY, DD-MM-YYYY).
- **Type**: Pattern
- **Example**:
```wfl
store date_input as "2025-08-10"
store result as find date_pattern in date_input
if result is not nothing:
display "Found date: " with result.match
end if
```

#### `time_pattern`
Matches time formats (HH:MM, HH:MM:SS, 12/24 hour with AM/PM).
- **Type**: Pattern
- **Example**:
```wfl
store time_input as "14:30:45"
if time_input matches time_pattern:
display "Valid time format"
end if
```

#### `uuid_pattern`
Matches UUID/GUID formats (8-4-4-4-12 hexadecimal pattern).
- **Type**: Pattern
- **Example**:
```wfl
store session_id as "550e8400-e29b-41d4-a716-446655440000"
if session_id matches uuid_pattern:
display "Valid UUID"
end if
```

## Type System Integration

All standard library functions are integrated with WFL's type checker:
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,7 @@ end pattern

If you encounter migration issues:

1. **Check Documentation:** Review the [Pattern Guide](wfl-pattern-guide.md) and [Unicode Patterns](wfl-unicode-patterns.md)
1. **Check Documentation:** Review the [Pattern Reference](../language-reference/wfl-patterns.md) and [Standard Library Patterns](../api/wfl-standard-library.md)
2. **Test Incrementally:** Migrate patterns one at a time
3. **Use Debug Mode:** Run patterns with `--debug` flag to see execution traces
4. **Create Minimal Examples:** Isolate problematic patterns for testing
Expand Down
File renamed without changes.
9 changes: 0 additions & 9 deletions Docs/implementation_progress_2025-08-04.md

This file was deleted.

51 changes: 0 additions & 51 deletions Docs/implementation_progress_2025-08-05.md

This file was deleted.

9 changes: 0 additions & 9 deletions Docs/implementation_progress_2025-08-06.md

This file was deleted.

Loading