@@ -897,15 +897,11 @@ Rule Parameter Description
897897======================= ========== ============================================= ===================================================
898898alpha No Fails if field has anything other than
899899 alphabetic characters in ASCII.
900- alpha_space No Fails if field contains anything other than
901- alphabetic characters or spaces in ASCII.
902900alpha_dash No Fails if field contains anything other than
903901 alphanumeric characters, underscores or
904902 dashes in ASCII.
905903alpha_numeric No Fails if field contains anything other than
906904 alphanumeric characters in ASCII.
907- alpha_numeric_space No Fails if field contains anything other than
908- alphanumeric or space characters in ASCII.
909905alpha_numeric_punct No Fails if field contains anything other than
910906 alphanumeric, space, or this limited set of
911907 punctuation characters: ``~ `` (tilde),
@@ -916,6 +912,10 @@ alpha_numeric_punct No Fails if field contains anything other than
916912 ``_ `` (underscore), ``+ `` (plus),
917913 ``= `` (equals), ``| `` (vertical bar),
918914 ``: `` (colon), ``. `` (period).
915+ alpha_numeric_space No Fails if field contains anything other than
916+ alphanumeric or space characters in ASCII.
917+ alpha_space No Fails if field contains anything other than
918+ alphabetic characters or spaces in ASCII.
919919decimal No Fails if field contains anything other than
920920 a decimal number. Also accepts a ``+ `` or
921921 ``- `` sign for the number.
@@ -940,9 +940,11 @@ in_list Yes Fails if field is not within a predetermined
940940integer No Fails if field contains anything other than
941941 an integer.
942942is_natural No Fails if field contains anything other than
943- a natural number: 0, 1, 2, 3, etc.
943+ a natural number: ``0 ``, ``1 ``, ``2 ``, ``3 ``
944+ , etc.
944945is_natural_no_zero No Fails if field contains anything other than
945- a natural number, except zero: 1, 2, 3, etc.
946+ a natural number, except zero: ``1 ``, ``2 ``,
947+ ``3 ``, etc.
946948is_not_unique Yes Checks the database to see if the given value ``is_not_unique[table.field,where_field,where_value] ``
947949 exists. Can ignore records by field/value to
948950 filter (currently accept only one filter).
@@ -964,47 +966,22 @@ not_in_list Yes Fails if field is within a predetermined
964966 list.
965967numeric No Fails if field contains anything other than
966968 numeric characters.
967- regex_match Yes Fails if field does not match the regular ``regex_match[/regex/] ``
968- expression.
969969permit_empty No Allows the field to receive an empty array,
970970 empty string, null or false.
971+ regex_match Yes Fails if field does not match the regular ``regex_match[/regex/] ``
972+ expression.
971973required No Fails if the field is an empty array, empty
972974 string, null or false.
973975required_with Yes The field is required when any of the other ``required_with[field1,field2] ``
974976 fields is not `empty() `_ in the data.
975977required_without Yes The field is required when any of the other ``required_without[field1,field2] ``
976978 fields is `empty() `_ in the data.
977- string No A generic alternative to the alpha* rules
979+ string No A generic alternative to the ** alpha* * * rules
978980 that confirms the element is a string
979981timezone No Fails if field does not match a timezone
980982 per `timezone_identifiers_list() `_
981983valid_base64 No Fails if field contains anything other than
982984 valid Base64 characters.
983- valid_json No Fails if field does not contain a valid JSON
984- string.
985- valid_email No Fails if field does not contain a valid
986- email address.
987- valid_emails No Fails if any value provided in a comma
988- separated list is not a valid email.
989- valid_ip Yes Fails if the supplied IP is not valid. ``valid_ip[ipv6] ``
990- Accepts an optional parameter of ``ipv4 `` or
991- ``ipv6 `` to specify an IP format.
992- valid_url No Fails if field does not contain (loosely) a
993- URL. Includes simple strings that could be
994- hostnames, like "codeigniter".
995- **Normally, ** ``valid_url_strict `` **should
996- be used. **
997- valid_url_strict Yes Fails if field does not contain a valid URL. ``valid_url_strict[https] ``
998- You can optionally specify a list of valid
999- schemas. If not specified, ``http,https ``
1000- are valid. This rule uses PHP's
1001- ``FILTER_VALIDATE_URL ``.
1002- valid_date Yes Fails if field does not contain a valid date. ``valid_date[d/m/Y] ``
1003- Any string that `strtotime() `_ accepts is
1004- valid if you don't specify an optional
1005- parameter that matches a date format.
1006- **So it is usually necessary to specify
1007- the parameter. **
1008985valid_cc_number Yes Verifies that the credit card number matches ``valid_cc_number[amex] ``
1009986 the format used by the specified provider.
1010987 Current supported providers are:
@@ -1025,11 +1002,37 @@ valid_cc_number Yes Verifies that the credit card number matches
10251002 Scotiabank Scotia Card (``scotia ``),
10261003 BMO ABM Card (``bmoabm ``),
10271004 HSBC Canada Card (``hsbc ``)
1005+ valid_date Yes Fails if field does not contain a valid date. ``valid_date[d/m/Y] ``
1006+ Any string that `strtotime() `_ accepts is
1007+ valid if you don't specify an optional
1008+ parameter that matches a date format.
1009+ **So it is usually necessary to specify
1010+ the parameter. **
1011+ valid_email No Fails if field does not contain a valid
1012+ email address.
1013+ valid_emails No Fails if any value provided in a comma
1014+ separated list is not a valid email.
1015+ valid_ip Yes Fails if the supplied IP is not valid. ``valid_ip[ipv6] ``
1016+ Accepts an optional parameter of ``ipv4 `` or
1017+ ``ipv6 `` to specify an IP format.
1018+ valid_json No Fails if field does not contain a valid JSON
1019+ string.
1020+ valid_url No Fails if field does not contain (loosely) a
1021+ URL. Includes simple strings that could be
1022+ hostnames, like "codeigniter".
1023+ **Normally, ** ``valid_url_strict `` **should
1024+ be used. **
1025+ valid_url_strict Yes Fails if field does not contain a valid URL. ``valid_url_strict[https] ``
1026+ You can optionally specify a list of valid
1027+ schemas. If not specified, ``http,https ``
1028+ are valid. This rule uses PHP's
1029+ ``FILTER_VALIDATE_URL ``.
10281030======================= ========== ============================================= ===================================================
10291031
10301032.. note :: You can also use any native PHP functions that return boolean and
10311033 permit at least one parameter, the field data to validate.
1032- The Validation library **never alters the data ** to validate.
1034+
1035+ .. important :: The Validation library **never alters the data** to validate.
10331036
10341037.. _timezone_identifiers_list() : https://www.php.net/manual/en/function.timezone-identifiers-list.php
10351038.. _strtotime() : https://www.php.net/manual/en/function.strtotime.php
0 commit comments