Suppose you want to find text in AcctNbr tags containing the numbers 48, 17, and 34 in any order. You could enumerate every possible ordering of those numbers, but that would become increasingly intractable as the number of things to be matched got larger (e.g., there are 24 possible orderings of four distinct things). This is where forward lookahead really shines.
(?-si)<AcctNbr>(?=(?:(?!</AcctNbr>).)*?17)(?=(?:(?!</AcctNbr>).)*?34)(?=(?:(?!</AcctNbr>).)*?48).*?</AcctNbr>
Try that out on the below text to see what I mean.
<AcctNbr>1 2 3 4</AcctNbr> <AcctNbr>1 2 23 14</AcctNbr> <AcctNbr>27</AcctNbr> <AcctNbr>1234</AcctNbr> <AcctNbr>34 18</AcctNbr> <AcctNbr>48734</AcctNbr> <FooNbr>34 17 48</FooNbr> <!-- last three should match --> <AcctNbr>34 17 48</AcctNbr> <AcctNbr>4817 34</AcctNbr> <AcctNbr>483417</AcctNbr>NOTE: this method allows overlap between things to be matched, e.g., 348 would count for both 34 and 48. There is no efficient way to do this without making the regex much nastier.