{"id":257,"date":"2023-03-21T10:10:00","date_gmt":"2023-03-21T10:10:00","guid":{"rendered":"https:\/\/www.devopssupport.in\/blog\/?p=257"},"modified":"2023-03-20T18:05:37","modified_gmt":"2023-03-20T18:05:37","slug":"regex-validations","status":"publish","type":"post","link":"https:\/\/www.devopssupport.in\/blog\/regex-validations\/","title":{"rendered":"Regex Validations"},"content":{"rendered":"\n<p>Regular\u00a0Expression or (Regex) is one of\u00a0the foremost\u00a0effective,\u00a0adaptable, and\u00a0proficient\u00a0content\u00a0preparing\u00a0approaches. Regex has its\u00a0possess\u00a0wordings, conditions, and\u00a0sentence structure; it is, in a sense, a\u00a0scaled down\u00a0programming\u00a0language.<\/p>\n\n\n\n<p>example:-<\/p>\n\n\n\n<p>This regex is use for Phone number validation<\/p>\n\n\n\n\/^[(]{0,1}[0-9]{3}[)]{0,1}[-\\s\\.]{0,1}[0-9]{3}[-\\s\\.]{0,1}[0-9]{4}$\/;\n\n\n\n<p>This simple regular expression just checks for 2 digits \/ 2 digits \/ 4 digits date format<\/p>\n\n\n\n\/^\\d{2}\\\/\\d{2}\\\/\\d{4}$\/\n\n\n\n<p>Complex regex for date <\/p>\n\n\n\n\/^(0[1-9]|1[0-2])\\\/(0[1-9]|1\\d|2\\d|3[01])\\\/(19|20)\\d{2}$\/\n\n\n\n<p>If you want to allow only alphanumeric characters, use this regular expression:<\/p>\n\n\n\n\/^[a-zA-Z0-9]*$\/\n\n\n\n<p>Decimal Numbers For decimal numbers with one decimal point, the regular expression is:<\/p>\n\n\n\n\/^[0-9]+\\.?[0-9]*$\/\n\n\n\n<p>If you want to allow only Standard email address<\/p>\n\n\n\n\/^([\\w-]+(?:\\.[\\w-]+)*)@((?:[\\w-]+\\.)*\\w[\\w-]{0,66})\\.([a-z]{2,6}(?:\\.[a-z]{2})?)$\/i\n\n\n\n<p>If you want supports alphabets and numbers no special characters except underscore(&#8216;_&#8217;) min 3 and max 20 characters<\/p>\n\n\n\n\/^[A-Za-z0-9_]{3,20}$\/;\n\n\n\n<p>If you want your password supports special characters and here min length\u00a0<em>6\u00a0<\/em>max 20 charters only<\/p>\n\n\n\n\/^[A-Za-z0-9!@#$%^&#038;*()_]{6,20}$\/;\n","protected":false},"excerpt":{"rendered":"<p>Regular\u00a0Expression or (Regex) is one of\u00a0the foremost\u00a0effective,\u00a0adaptable, and\u00a0proficient\u00a0content\u00a0preparing\u00a0approaches. Regex has its\u00a0possess\u00a0wordings, conditions, and\u00a0sentence structure; it is, in a sense, a\u00a0scaled down\u00a0programming\u00a0language. example:- This regex is use for&#8230; <\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[91,90,89,87,88],"class_list":["post-257","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-alphanumeric","tag-date","tag-phone-number-validation","tag-regex","tag-regex-validations"],"_links":{"self":[{"href":"https:\/\/www.devopssupport.in\/blog\/wp-json\/wp\/v2\/posts\/257","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.devopssupport.in\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.devopssupport.in\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.devopssupport.in\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.devopssupport.in\/blog\/wp-json\/wp\/v2\/comments?post=257"}],"version-history":[{"count":1,"href":"https:\/\/www.devopssupport.in\/blog\/wp-json\/wp\/v2\/posts\/257\/revisions"}],"predecessor-version":[{"id":258,"href":"https:\/\/www.devopssupport.in\/blog\/wp-json\/wp\/v2\/posts\/257\/revisions\/258"}],"wp:attachment":[{"href":"https:\/\/www.devopssupport.in\/blog\/wp-json\/wp\/v2\/media?parent=257"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devopssupport.in\/blog\/wp-json\/wp\/v2\/categories?post=257"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devopssupport.in\/blog\/wp-json\/wp\/v2\/tags?post=257"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}