this response is invalid response if you specify both an allowregexes and blockregexes argumentthe allow list overrides the block list for exampleenter the following into the interactive shellwhich allows 'caterpillarand 'categorybut blocks anything else that has the word 'catin itimport pyinputplus as pyip response pyip inputstr(allowregexes=[ 'caterpillar''category']blockregexes=[ 'cat']cat this response is invalid catastrophe this response is invalid category response 'categorythe pyinputplus module' functions can save you from writing tedious input validation code yourself but there' more to the pyinputplus module than what has been detailed here you can examine its full documentation online at passing custom validation function to inputcustom(you can write function to perform your own custom validation logic by passing the function to inputcustom(for examplesay you want the user to enter series of digits that adds up to there is no pyinputplus inputaddsuptoten(functionbut you can create your own function thataccepts single string argument of what the user entered raises an exception if the string fails validation returns none (or has no return statementif inputcustom(should return the string unchanged returns nonnone value if inputcustom(should return different string from the one the user entered is passed as the first argument to inputcustom(for examplewe can create our own addsuptoten(functionand then pass it to inputcustom(note that the function call looks like inputcustom(addsuptotenand not inputcustom(addsuptoten()because we are passing the addsuptoten(function itself to inputcustom()not calling addsuptoten(and passing its return value import pyinputplus as pyip def addsuptoten(numbers)input validation