FIND YOUR NEXT FEW LINES

Results for “Text validation & formatting”

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

939 snippets foundClear filters
Bash ScriptsInput streams & redirection

Capture standard output and standard error separately

Bash Scripts: Use distinct redirections when diagnostic text should not be mixed with data.

Bash Scripts✓ Tested
SQL ServerTransactions & tables

Catch a T-SQL error

Handle an expected conversion error in TRY/CATCH.

TRY CATCH✓ Tested
PostgresJSON & arrays

Check JSONB containment

Test whether an object contains a key-value pair.

jsonb✓ Tested
PythonFile operations & archives

Clean up a temporary directory automatically

Python: Use TemporaryDirectory as a context manager so cleanup also happens after exceptions.

Python✓ Tested
PostgresJSON & arrays

Collect ordered values into an array

Build a sorted array from query rows.

array_agg✓ Tested
SQLJoins & subqueries

Combine matching rows with INNER JOIN

Read product names with their matching stock values.

INNER JOIN✓ Tested
SQLBulk changes & set operations

Combine results while retaining duplicates

SQL: UNION ALL does not spend work removing equal rows.

SQL✓ Tested
SQL ServerBulk changes & set operations

Combine results while retaining duplicates

SQL Server: UNION ALL does not spend work removing equal rows.

SQL Server✓ Tested
PostgresBulk changes & set operations

Combine results while retaining duplicates

Postgres: UNION ALL does not spend work removing equal rows.

Postgres✓ Tested
SQLiteBulk changes & set operations

Combine results while retaining duplicates

SQLite: UNION ALL does not spend work removing equal rows.

SQLite✓ Tested
SQLChange & combine data

Combine results without duplicates

Merge compatible result sets with UNION.

UNION✓ Tested
SQLSchema design & transactions

Commit multiple related changes together

SQL: The first transaction prepares the fixtures. The second commits both updates as one unit.

SQL✓ Tested