Regular Expression Is In

reisin
Arguments:
  • $1 - Regex to search for

  • [$2…] - Values of array to search over

Output:

Exit code is 0 for found, 1 for not found

Bash CLI version of reisin

See also

reisin

reisin
Arguments:
  • $1 - Regex to search for

  • [$2…] - Values of array to search over

Output:

Returns 0 for found, 1 for not found

Checks if any string in the array matches a regex

Example

reisin '[35]' 11 22 33 44
# $? is 0
reisin '^.*1.*$' 20 20 20
# $? is 1