Skip to main content

contains

Check if a string contains a substring or matches a regex. Returns true if found.


Examples

Check if /etc/passwd content contains root:

file("/etc/passwd").content.contains("root")