> On Feb 11, 2020, at 6:58, Tom Robinson <[email protected]> wrote:
>
> What have I missed here guys?
>
> I want to match entire lines which are empty, contain a single ’s’, or
> contain ‘e’ and/or ‘h’ (in that order):
>
> e
> h
> eh
> s
>
> ehs
> he
> x
>
> The first 5 lines should match (including the empty line), last 3 shouldn’t.
>
> But despite the caret anchor, my pattern is catching the ending of unwanted
> lines:
>
> ^s|(e?h?)$
Tom,
The results are
[e]
[h]
[eh]
[s]
[]
ehs
h[e]
x
[]
So, it looks like the regex works like this:
^s
or
(e?h?)$
This one: ^s$|^(e?h?)$ seems to do what you want.
Jean-Christophe Helary
-----------------------------------------------
http://mac4translators.blogspot.com @brandelune
--
This is the BBEdit Talk public discussion group. If you have a feature request
or need technical support, please email "[email protected]" rather than
posting here. Follow @bbedit on Twitter: <https://twitter.com/bbedit>
---
You received this message because you are subscribed to the Google Groups
"BBEdit Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/bbedit/876A6DC3-19BF-491A-8F64-9CD162C79D4C%40traduction-libre.org.