I am trying to re-specify the date from a text file. This content is:
Warehouse Manager Administrative command-line interface - version 7, release 1, level 1.4 (c) Copyright from the corporation and others 1990, 2015. All rights reserved.
Session installed with TSERVER server: Windows Server version 7, release 1, level 5.200 Server date and time: 11/22/2016 15:30:00 Last access: 11/22/2016 15:25:00
Server command ANS8000I.
I need to extract the date / time after the server date / time. I wrote this regular expression:
/([0-9]{1,2}\/[0-9]{1,2}\/[0-9]{4} [0-9]{1,2}:[0-9]{1,2}:[0-9]{1,2})/
This works great in regex101. See Example https://regex101.com/r/MB7yB4/1 However, in Powershell it responds to different ones.
$var -match "([0-9]{1,2}\/[0-9]{1,2}\/[0-9]{4} [0-9]{1,2}:[0-9]{1,2}:[0-9]{1,2})"
gives
Server date and time: 11/22/2016 16:30:00 Last access: 11/22/2016 15:37:19
and
$var -match "([0-9]{1,2}\/[0-9]{1,2}\/[0-9]{4} [0-9]{1,2}:[0-9]{1,2}:[0-9]{1,2})"
gives nothing.
I'm not sure why the match is not the same.
Thanks for any help!