Results for “syntax”
Small, practical examples. Search by task or narrow things down below.
Check a script’s syntax without executing its body
Bash Scripts: bash -n parses commands but does not run ordinary script statements.
Bash Scripts✓ Tested
Extract a substring with range syntax
C#: C# range ends are exclusive; indices operate on UTF-16 code units.
C#✓ Tested
Mount a local input directory with long syntax
Docker / Compose: Long mount syntax makes the bind type and read-only intent explicit.
Docker / Compose✓ Tested
Parse an email address syntax
Parse an email address syntax using a complete Go program with explicit sample inputs.
Go✓ Tested
Validate email syntax with Angular’s email validator
Validate email syntax with Angular’s email validator with a standalone Angular component and explicit browser behavior.
Angular✓ Tested
Convert a Unix timestamp to UTC
Linux Commands: Use the @ syntax with GNU date for seconds since the Unix epoch.
Linux Commands✓ Tested
Normalize a path without touching the filesystem
C++: lexically_normal removes redundant dot components using path syntax alone.
C++✓ Tested
Read the exact version currently staged
Git: The colon path syntax reads a blob from the index rather than from HEAD or the working file.
Git✓ Tested
Replace every occurrence in a string
Substitute text directly with Bash parameter expansion.
replace✓ Tested
Set an image’s default command
Use JSON array syntax for a predictable command.
Dockerfile✓ Tested
Validate the shape of an absolute URL
HTML: A URL input checks syntax, not whether a resource exists or is safe.
HTML✓ Tested