I'm trying to to get the date from the linux command "passwd". What im doing is this, i am storing users in the array @user and i want to run the command "passwd -S" on every user. When i i run "passwd -S user1" it returns this:

```
user PS 2016-02-16 0 99999 7 -1 (Password set, SHA512 crypt.)

```

I came up with a regular expression to only get the date from that string, the regex looks like this:'

```
\d{4}-\d{2}-\d{2}

```

However when i combine that with grep i cannot seem to get it to work, it still outputs the full output from the "passwd" command. Here is the code:

```
PasswordAge();

sub PasswordAge {
    for my $loop (@user) {
        my $pass =qx(passwd -S $loop);
        my @splitpass = grep {/\d{4}-\d{2}-\d{2}/} $pass;
        print @splitpass;
    }
}

```