FIND YOUR NEXT FEW LINES

Results for “search”

Small, practical examples. Search by task or narrow things down below.

46 snippets foundClear filters
GoSlices & collections

Find an item’s index

Find an item’s index using a complete Go program with explicit sample inputs.

Go✓ Tested
GitCommits & history

Find commits by message

Search commit subjects and bodies for a phrase.

log✓ Tested
Linux CommandsSearching text

List files containing a match

Linux Commands: Use grep -l when only the matching filenames are needed.

Linux Commands✓ Tested
JavaQueues & collection operations

Locate a value in a sorted array

Java: Use Arrays.binarySearch only after establishing ascending order.

Java✓ Tested
Linux CommandsSearching text

Match a whole word

Linux Commands: Use grep -w to exclude a matching substring inside a longer word.

Linux Commands✓ Tested
Linux CommandsSearching text

Match any pattern from a file

Linux Commands: Use grep -F -f with one literal pattern per line.

Linux Commands✓ Tested
Linux CommandsSearching text

Print only the matching portions

Linux Commands: Use extended regex and -o to extract digit sequences.

Linux Commands✓ Tested
Linux CommandsSearching text

Show line numbers beside matches

Linux Commands: Use grep -n so a result identifies its position in the source file.

Linux Commands✓ Tested
JavaScriptRegular expressions & URL encoding

Build a URL query string from values

JavaScript: URLSearchParams handles query escaping and repeated parameter appends.

JavaScript✓ Tested
TypeScriptRegular expressions & URL encoding

Build a URL query string from values

TypeScript: URLSearchParams handles query escaping and repeated parameter appends.

TypeScript✓ Tested
Bash ScriptsArray operations

Check exact array membership

Bash Scripts: Compare each element literally instead of searching a concatenated string.

Bash Scripts✓ Tested
CArrays

Find an array element

Use a bounded linear search over a C array.

C✓ Tested