<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><meta content="text/html;charset=UTF-8" http-equiv="Content-Type"></head><body ><div style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10pt;"><div>I have a ReadStream and I want to detect some substrings in it.<br></div><div><br></div><div>This works, but it is ugly.<br></div><div><br></div><div><br></div><div><blockquote style="border: 1px solid rgb(204, 204, 204); padding: 7px; background-color: rgb(245, 245, 245);"><div>((self match:'{|') | <br></div><div>(self match:'|-') |<br></div><div>(self match:'|}') |<br></div><div>(self match:'{{') |<br></div><div>(self match:'}}') |<br></div><div>(self match:'[[') |<br></div><div>(self match:']]') |<br></div><div>(self match:'__') |<br></div><div>(self match:'==') |<br></div><div>(self match:'::') |<br></div><div>(self match:'**') |<br></div><div>(self match:'##') |<br></div><div>(self match:'''') )<br></div></blockquote><br></div><div>Is anybody aware of an elegant approach to this?<br></div><div><br></div><div><br></div><div>Something along the lines of <br></div><div><br></div><div><br></div><div><blockquote style="border: 1px solid rgb(204, 204, 204); padding: 7px; background-color: rgb(245, 245, 245);"><div>self matchAny: { '{|'  . '|-' . '|}' . '{{' . '}}' .  '[[' . ']]' . '__' . '==' . '::' . '**' . '##' . '''' }<br></div></blockquote><br></div><div><br></div><div>thx in advance</div></div><br></body></html>