Skip to content

Conversation

@haribabuk113
Copy link
Contributor

Fixes Or Enhances

Make sure that you've checked the boxes below before you submit PR:

  • Tests exist or have been written that cover this particular change.

@go-playground/validator-maintainers

I’ve been using this package in several projects at our company. Yesterday, while searching for a validation tag that supports alphanumeric characters and spaces for Go structs, I was unable to find an existing one. To address this, I created a regex pattern that allows alphabets, numbers, and spaces.

This pull request adds that regex-based validation tag to the package, extending its functionality for common text fields requiring alphanumeric and space support.

Summary of Changes
Added a new regex validation tag supporting alphabets, numbers, and spaces

Included documentation and tests for the new tag

@haribabuk113 haribabuk113 requested a review from a team as a code owner November 1, 2025 14:48
@coveralls
Copy link

coveralls commented Nov 1, 2025

Coverage Status

coverage: 73.749% (+0.004%) from 73.745%
when pulling d94746d on haribabuk113:master
into 80b6d11 on go-playground:master.

.golangci.yaml Outdated
- varnamelen
- wrapcheck
- wsl
- modernize
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this change is not needed anymore. Please rebase

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rebase is done.

@nodivbyzero
Copy link
Contributor

Thank you for your contribution to the go-playground/validator project.

The changes look good.

Could you add a description of your validator to doc.go?
https://github.com/go-playground/validator/blob/master/doc.go

@haribabuk113
Copy link
Contributor Author

Thank you for your contribution to the go-playground/validator project.

The changes look good.

Could you add a description of your validator to doc.go? https://github.com/go-playground/validator/blob/master/doc.go

Descritpion for his validator tag is added to doc.go

.golangci.yaml Outdated
- varnamelen
- wrapcheck
- wsl
- wsl
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change isn’t related to the alphanumspace string validator.
Could you please revert this file?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file has been reverted.

@haribabuk113 haribabuk113 marked this pull request as draft December 3, 2025 03:21
@haribabuk113 haribabuk113 marked this pull request as ready for review December 3, 2025 03:31
@nodivbyzero nodivbyzero merged commit 0c1335d into go-playground:master Dec 5, 2025
8 checks passed
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.

3 participants