Skip to content

Commit

Permalink
Fix missing closing parenthesis in Input_Validation_Cheat_Sheet.md
Browse files Browse the repository at this point in the history
The missing parenthesis has been added after matches()
  • Loading branch information
abdulhaseeb-co authored Jan 23, 2024
1 parent 53593d9 commit 03e244e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cheatsheets/Input_Validation_Cheat_Sheet.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ private static final Pattern zipPattern = Pattern.compile("^\d{5}(-\d{4})?
public void doPost( HttpServletRequest request, HttpServletResponse response) {
try {
      String zipCode = request.getParameter( "zip" );
      if ( !zipPattern.matcher( zipCode ).matches()  {
      if ( !zipPattern.matcher( zipCode ).matches() ) {
          throw new YourValidationException"Improper zipcode format." );
      }
      // do what you want here, after its been validated ..
Expand Down

0 comments on commit 03e244e

Please sign in to comment.