Correction



Sorry, misspelling: please read "(?<sentence>.*(?<eos>[^\\][\\]{1}$)?)"
as "(?<sentence>.*(?<eos>[^/][/]{1}$)?)"

J.

Jules wrote:
All,

how do I describe a string consisting of any number of characters, with
an optional (but unique when occuring) end-of-line expression '/'? With
groups if possible, as in "(?<sentence>.*(?<eos>[^\\][\\]{1}$)?)"

Say I have the phrase 'My Taylor is /' as input; I'd like 'sentence'
and 'eos' to match.

Now if I have 'My Taylor is //' or 'My Taylor is / ', 'sentence' should
match, but not 'eos'. In other words, 'eos' should match only when it
occurs once, and last, in the string.

I have tried nesting eos within sentence, juxtaposing them, removing
quantifiers, removing the end-of-string assertion... nothing seems to
work satisfactorily.

Thanks for any help,
Jules

.


Loading