Can someone tell me why this expression does not produce a match with one space at the end:
$MyPattern = '^(5[1-5]\d{14})|(5[1-5]\d{2}[-| ]\d{4}[-| ]\d{4}[-| ]\d{4})$'
$MyString = 'MC1 5111-1234-1234-1234'"Why this string '$MyString' matches: $($mystring -match $mypat)"
$MyString = 'MC1 5111-1234-1234-1234 '"but this string '$MyString' does not: $($mystring -match $mypat)"Sam Boutros, Senior Consultant, Software Logic, KOP, PA http://superwidgets.wordpress.com (Please take a moment to Vote as Helpful and/or Mark as Answer, where applicable)