{"id":19000627,"date":"2026-08-23T12:56:10","date_gmt":"2026-08-23T12:56:10","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/regex-for-username\/"},"modified":"2026-08-23T12:58:04","modified_gmt":"2026-08-23T12:58:04","slug":"regex-for-username","status":"publish","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/regex-for-username\/","title":{"rendered":"Regex for username"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">I want to allow only user name with small <strong>a-z<\/strong> and <strong>dot <\/strong>and <strong>underscore<\/strong> only in a <strong>middle <\/strong>!<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">I have this <strong>regex <\/strong>: <strong>^[a-z_.]$<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">But how to allow <strong>dot <\/strong>and <strong>underscore <\/strong>only in a <strong>middle <\/strong>and not at <strong>start <\/strong>and of at <strong>end <\/strong>of the string ?<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Thanks<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"template":"","class_list":["post-19000627","topic","type-topic","status-publish","hentry","topic-tag-regex","topic-tag-validation"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/19000627","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":1,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/19000627\/revisions"}],"predecessor-version":[{"id":19000628,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/19000627\/revisions\/19000628"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=19000627"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}