Skip to content

fix: improve email validation regex to allow digits in domain parts#3959

Open
emerencia wants to merge 1 commit intodevelopfrom
fix/claude-code-bug-fix
Open

fix: improve email validation regex to allow digits in domain parts#3959
emerencia wants to merge 1 commit intodevelopfrom
fix/claude-code-bug-fix

Conversation

@emerencia
Copy link
Member

Summary

The email validation regex did not allow digits in intermediate domain parts (e.g., user@mail2.example.com or user@sub1.domain.com).

Changes

  • Fixed the email validation regex in Person model to allow alphanumeric characters in domain parts
  • Added comprehensive RSpec tests for email validation edge cases

Testing

Added spec/models/person_email_spec.rb with tests covering:

  • Valid email formats (including digits and hyphens in domains)
  • Invalid email formats
  • Blank/nil values
  • Edge cases for digits and hyphens in domain parts

Created by Claude Code via Clawdbot

The previous regex did not allow digits in intermediate domain parts
(e.g., user@sub1.example.com). This fix allows alphanumeric characters
in domain parts.

Also adds comprehensive RSpec tests for email validation edge cases.
@emerencia emerencia changed the base branch from master to develop February 6, 2026 15:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments