diff --git a/datamodel_code_generator/format.py b/datamodel_code_generator/format.py
index 1b2ffb53..a742d884 100644
--- a/datamodel_code_generator/format.py
+++ b/datamodel_code_generator/format.py
@@ -51,7 +51,7 @@ def black_find_project_root(sources: Sequence[Path]) -> Path:
     project_root = _find_project_root(tuple(str(s) for s in sources))
     if isinstance(project_root, tuple):
         return project_root[0]
-    else:
+    else:  # pragma: no cover
         return project_root
 
 
diff --git a/datamodel_code_generator/parser/jsonschema.py b/datamodel_code_generator/parser/jsonschema.py
index 312a786b..5b666378 100644
--- a/datamodel_code_generator/parser/jsonschema.py
+++ b/datamodel_code_generator/parser/jsonschema.py
@@ -670,7 +670,7 @@ class JsonSchemaParser(Parser):
                             is_dict=True,
                             dict_key=self.data_type_manager.get_data_type(
                                 Types.string,
-                                pattern=k,
+                                pattern=k if not self.field_constraints else None,
                             ),
                         )
                         for k, v in item.patternProperties.items()

diff --git a/tests/data/expected/main/main_pattern_properties_field_constraints/output.py b/tests/data/expected/main/main_pattern_properties_field_constraints/output.py
new file mode 100644
index 00000000..446ff3a2
--- /dev/null
+++ b/tests/data/expected/main/main_pattern_properties_field_constraints/output.py
@@ -0,0 +1,17 @@
+# generated by datamodel-codegen:
+#   filename:  pattern_properties.json
+#   timestamp: 2019-07-26T00:00:00+00:00
+
+from __future__ import annotations
+
+from typing import Dict, Optional
+
+from pydantic import BaseModel
+
+
+class Bar(BaseModel):
+    name: Optional[str] = None
+
+
+class Foo(BaseModel):
+    bar: Dict[str, Bar]
diff --git a/tests/test_main.py b/tests/test_main.py
index 8905a357..608a18e6 100644
--- a/tests/test_main.py
+++ b/tests/test_main.py
@@ -3480,6 +3480,34 @@ def test_jsonschema_pattern_properties():
         main()
 
 
+@freeze_time('2019-07-26')
+def test_jsonschema_pattern_properties_field_constraints():
+    with TemporaryDirectory() as output_dir:
+        output_file: Path = Path(output_dir) / 'output.py'
+        return_code: Exit = main(
+            [
+                '--input',
+                str(JSON_SCHEMA_DATA_PATH / 'pattern_properties.json'),
+                '--output',
+                str(output_file),
+                '--input-file-type',
+                'jsonschema',
+                '--field-constraints',
+            ]
+        )
+        assert return_code == Exit.OK
+        assert (
+            output_file.read_text()
+            == (
+                EXPECTED_MAIN_PATH
+                / 'main_pattern_properties_field_constraints'
+                / 'output.py'
+            ).read_text()
+        )
+    with pytest.raises(SystemExit):
+        main()
+
+
 @freeze_time('2019-07-26')
 def test_jsonschema_titles():
     with TemporaryDirectory() as output_dir:

Optional command to generate code without constr
**Is your feature request related to a problem? Please describe.**

The inclusion of `constr` in the generated datamodel when it contains regular expressions can cause the generated code to fail checks in mypy and flake8.

Specifically, with `https://github.com/compose-spec/compose-spec/blob/master/schema/compose-spec.json` as the target file, the following command attempts to generate the code.
````
datamodel-codegen --input compose-spec.json --input-file-type jsonschema --output model.py --field-constraints --target-python-version 3.8
````

Part of the generated result contains the following code
```
    services: Optional[Dict[constr(regex=r'^[a-zA-Z0-9._-]+$'), Service]] = None
````
This fails on mypy and flake8 checks.

**Describe the solution you'd like**

The reason for the failure seems to be the use of constr, so I would like an optional command that outputs in a format that does not contain constr (nor conint).

**Describe alternatives you've considered**

If there is already an optional command that accomplishes this kind of functionality, it would be great to know.
I have already tried the `--field-constraints`, `-use-annotated` option commands, etc., but they did not solve this problem.

**Additional context**

If it is difficult to express a constraint by regular expression without using constr, I would like to see a behavior that replaces constr with str and outputs a warning.


Thank you for creating such a great package.
tests/test_main.py::test_jsonschema_pattern_properties_field_constraints
tests/test_main.py::test_main_json tests/test_main.py::test_csv_stdin tests/test_main.py::test_main_modular_reuse_model tests/test_main.py::test_main_json_reuse_model tests/test_main.py::test_main_jsonschema_nested_deep tests/test_main.py::test_main_root_model_with_additional_properties tests/test_main.py::test_jsonschema_without_titles_use_title_as_name tests/test_main.py::test_main_openapi_json_pointer tests/test_main.py::test_main_jsonschema_multiple_files_json_pointer tests/test_main.py::test_main_generate_custom_class_name_generator_modular tests/test_main.py::test_main_jsonschema_field_include_all_keys tests/test_main.py::test_main_with_aliases tests/test_main.py::test_main_nested_directory tests/test_main.py::test_main_json_pointer tests/test_main.py::test_target_python_version tests/test_main.py::test_enable_faux_immutability tests/test_main.py::test_main_autodetect tests/test_main.py::test_main_without_field_constraints tests/test_main.py::test_main_all_of_ref tests/test_main.py::test_main_json_reuse_enum_default_member tests/test_main.py::test_main_openapi_datetime tests/test_main.py::test_main_json_reuse_enum tests/test_main.py::test_main_openapi_oas_response_reference tests/test_main.py::test_main_openapi_body_and_parameters_only_schemas tests/test_main.py::test_main_root_model_with_additional_properties_literal tests/test_main.py::test_main_with_bad_extra_data tests/test_main.py::test_main_models_not_found tests/test_main.py::test_main_generate_custom_class_name_generator_additional_properties tests/test_main.py::test_main_with_snake_case_field tests/test_main.py::test_space_and_special_characters_dict tests/test_main.py::test_main_modular_filename tests/test_main.py::test_main_jsonschema_special_enum_empty_enum_field_name tests/test_main.py::test_pyproject_not_found tests/test_main.py::test_jsonschema_titles tests/test_main.py::test_use_default tests/test_main.py::test_main_null_and_array tests/test_main.py::test_main_generate tests/test_main.py::test_main_jsonschema_combine_any_of_object tests/test_main.py::test_space_and_special_characters_json tests/test_main.py::test_main_disable_appending_item_suffix tests/test_main.py::test_csv_file tests/test_main.py::test_main_use_generic_container_types_py36 tests/test_main.py::test_main_with_more_bad_aliases tests/test_main.py::test_main_jsonschema_pattern tests/test_main.py::test_main_json_arrary_include_null tests/test_main.py::test_main_jsonschema_field_extras tests/test_main.py::test_main_strict_types tests/test_main.py::test_main_all_of_with_object tests/test_main.py::test_main_with_bad_aliases tests/test_main.py::test_main_external_definitions tests/test_main.py::test_version tests/test_main.py::test_main_jsonschema_id tests/test_main.py::test_main_modular_no_file tests/test_main.py::test_allow_population_by_field_name tests/test_main.py::test_main_circular_reference tests/test_main.py::test_main_autodetect_failed tests/test_main.py::test_main_jsonschema_multiple_files_ref_test_json tests/test_main.py::test_jsonschema_titles_use_title_as_name tests/test_main.py::test_main_openapi_body_and_parameters_only_paths tests/test_main.py::test_validation_failed tests/test_main.py::test_main_generate_from_directory tests/test_main.py::test_main_jsonschema_id_as_stdin tests/test_main.py::test_main_yaml tests/test_main.py::test_main_custom_template_dir tests/test_main.py::test_stdin tests/test_main.py::test_main_openapi_content_in_parameters tests/test_main.py::test_main_external_files_in_directory tests/test_main.py::test_main_root_model_with_additional_properties_use_generic_container_types tests/test_main.py::test_main_openapi_nullable_strict_nullable tests/test_main.py::test_main_jsonschema_field_extras_field_include_all_keys tests/test_main.py::test_long_description tests/test_main.py::test_main_json_failed tests/test_main.py::test_main_nested_json_pointer tests/test_main.py::test_main_use_annotated_with_field_constraints tests/test_main.py::test_main_strict_types_all_with_field_constraints tests/test_main.py::test_main_jsonschema_complex_any_of tests/test_main.py::test_main tests/test_main.py::test_main_complicated_enum_default_member tests/test_main.py::test_validation tests/test_main.py::test_main_jsonschema_multiple_files tests/test_main.py::test_main_with_field_constraints tests/test_main.py::test_main_no_file tests/test_main.py::test_main_jsonschema_external_files tests/test_main.py::test_main_openapi_body_and_parameters tests/test_main.py::test_simple_json_snake_case_field tests/test_main.py::test_main_generate_custom_class_name_generator tests/test_main.py::test_jsonschema_pattern_properties tests/test_main.py::test_main_invalid_model_name_converted tests/test_main.py::test_main_openapi_pattern tests/test_main.py::test_main_self_reference tests/test_main.py::test_main_jsonschema_field_extras_field_extra_keys tests/test_main.py::test_force_optional tests/test_main.py::test_main_invalid_model_name tests/test_main.py::test_main_jsonschema_special_enum tests/test_main.py::test_main_with_strip_default_none tests/test_main.py::test_main_root_model_with_additional_properties_use_standard_collections tests/test_main.py::test_main_similar_nested_array tests/test_main.py::test_main_openapi_nullable tests/test_main.py::test_main_jsonschema_complex_one_of tests/test_main.py::test_main_jsonschema_combine_one_of_object tests/test_main.py::test_main_jsonschema_ids tests/test_main.py::test_main_invalid_enum_name tests/test_main.py::test_main_with_exclusive tests/test_main.py::test_main_jsonschema tests/test_main.py::test_main_jsonschema_unsupported_parent_class tests/test_main.py::test_main_jsonschema_special_field_name tests/test_main.py::test_main_invalid_model_name_failed tests/test_main.py::test_main_base_class tests/test_main.py::test_main_subclass_enum tests/test_main.py::test_disable_timestamp tests/test_main.py::test_main_jsonschema_multiple_files_ref tests/test_main.py::test_main_use_standard_collections tests/test_main.py::test_main_modular