Regular Expressions 101

Community Patterns

Get IdentityFile for Host in ssh_config

0

Regular Expression
PCRE (PHP <7.3)

/
Host\s+host2\s.*?IdentityFile\s+(?<identity>\S+)
/
s

Description

Sample regex to get the address to SSH IdentityFile for Host in ssh_config.

Submitted by anonymous - 3 years ago