PREV INDEX NEXT

Author: Stan Eisenstat
Subject: Re: [Cs223] None
Date: Thursday, 27 Feb 2020, 20:17:43


    > Message Posted By: Edge case
    >
    > Hii when I try to run staff solution:
    > ./strwrs ./str d
    > and input "./str"
    > it will only output "./str"
    > Shouldn't it output "d"?

No.  As stated in the specification:

  To allow a + to be the first character of a match, or a - to be the last
  character of a match, a / (forward slash) escapes the character immediately
  following (but not a newline or the terminating null character) just as a \
  (backslash) escapes a following \ or " in a C string.  ...

Thus ./str matches .str, not ./str, in the input.

--Stan-
PREV INDEX NEXT