\d represents a digit; it is the same as using [0-9].
# Similarly to ^, the shortcut \A matches the beginning of a string opening = "This is a test. \nThis is a test. This is a test. ,\n" opening.grep(/\Athis in/)