Sök…


Regexp-mönster

Mönster kan anges som vanliga uttryck:

/regular expression/ {action}

Till exempel:

echo "[email protected]
not an email" | awk '/[^@]+@.+/ {print}'

producerar:

[email protected]

Observera att en åtgärd som endast består av print kan utelämnas helt. Exemplet ovan motsvarar:

echo "[email protected]
not an email" | awk '/[^@]+@.+/'


Modified text is an extract of the original Stack Overflow Documentation
Licensierat under CC BY-SA 3.0
Inte anslutet till Stack Overflow