Recherche…


Regexp Patterns

Les patterns peuvent être spécifiés comme des expressions régulières:

/regular expression/ {action}

Par exemple:

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

Produit:

[email protected]

Notez qu'une action composée uniquement de l'instruction print peut être omise entièrement. L'exemple ci-dessus est équivalent à:

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


Modified text is an extract of the original Stack Overflow Documentation
Sous licence CC BY-SA 3.0
Non affilié à Stack Overflow