feat: add regex for in-form validation

Amolith created

References: https://todo.sr.ht/~singpolyma/soprani.ca/380

Change summary

forms/set_port_out_pin.rb | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)

Detailed changes

forms/set_port_out_pin.rb 🔗

@@ -10,7 +10,8 @@ field(
 	type: "text-private",
 	label: "Port-out PIN",
 	required: true,
-	description: "Enter 4-10 alphanumeric characters"
+	description: "Enter 4-10 alphanumeric characters",
+	regex: /\A[\w\d]{4,10}\Z/
 )
 
 field(
@@ -18,5 +19,6 @@ field(
 	type: "text-private",
 	label: "Confirm PIN",
 	required: true,
-	description: "Re-enter the same PIN to confirm"
+	description: "Re-enter the same PIN to confirm",
+	regex: /\A[\w\d]{4,10}\Z/
 )