Results for “match”
Small, practical examples. Search by task or narrow things down below.
Check whether input is a nonnegative integer
Reject empty input and nonnumeric characters before arithmetic.
validation✓ Tested
Choose among several numeric ranges
Bash Scripts: An if-elif chain evaluates branches in order and executes the first match.
Bash Scripts✓ Tested
Compare a command case-sensitively
Arduino / C: strcmp returns zero when both null-terminated strings match.
Arduino / C✓ Tested
Convert a variable to uppercase
Bash Scripts: Double caret transforms matching lowercase characters in Bash 4 or later.
Bash Scripts✓ Tested
Count elements satisfying a predicate
C++: count_if counts matches without constructing a filtered collection.
C++✓ Tested
Declare LF normalization for a file type
Git: A gitattributes rule records text normalization expectations for matching paths.
Git✓ Tested
Dispatch values with wildcard patterns
PowerShell: Switch -Wildcard interprets shell-style matching patterns for each clause.
PowerShell✓ Tested
Exclude elements from a collection
jQuery: not removes matching elements from the current selection.
jQuery✓ Tested
Extract a basename without an external process
Bash Scripts: Double hash removes the longest matching prefix ending in a slash.
Bash Scripts✓ Tested
Extract a parent path with parameter expansion
Bash Scripts: Percent removes the shortest matching slash-and-suffix portion.
Bash Scripts✓ Tested
Extract numbers from text
Find all runs of ASCII digits in a string and convert the matches to integers.
regex✓ Tested
Filter a selection
Reduce a jQuery selection to elements with a matching class.
jQuery✓ Tested