pattern values and "||"/"&&" operators

In implementing bitwise operations for counts (now pretty much done!),
I found that Bro's internals actually support "||" and "&&" operators for
patterns:

  p1 || p2 returns a pattern that matches either p1 or p2
  p1 && p2 returns a pattern that matches p1 followed by p2

(Note that this second is not obvious. One might instead expect it to
return a pattern that matches only if both p1 and p2 match, where the two
could overlap.)

This doesn't appear to be documented anywhere. I discussed it with Robin
and we both agree that this seems weird and likely not used anywhere.
Therefore we're thinking we should deprecate it and eventually remove it.

Anyone think otherwise?

    Vern

Sounds fine to me - I totally was not aware of this. Though having the functionality of the former available in some form would be kind of nice-I have a few scripts where I would have used that.

Johanna

> p1 || p2 returns a pattern that matches either p1 or p2

... Though having the
functionality of the former available in some form would be kind of
nice-I have a few scripts where I would have used that.

Oh I left out that that's in fact supported:

  print /foo/ | /bar/ in "hello Barbara";

prints "T" :-). As does

  print (/foo/ || /bar/) in "hello Barbara";

(parens now required), which is the one we'd be getting rid of.

    Vern