diff options
Diffstat (limited to 'txr.1')
-rw-r--r-- | txr.1 | 13 |
1 files changed, 8 insertions, 5 deletions
@@ -639,7 +639,7 @@ with a backslash. Two backslashes code for one backslash. So for instance [\e[\e-] means match a [ or - character, [^^] means match any character other than ^, and [\e^\e\e] means match either a ^ or a backslash. Regex operators such as *, + and & appearing in a character -class represent ordinary characters. The characters -, ] and ^ occuring outside +class represent ordinary characters. The characters -, ] and ^ occurring outside of a character class are ordinary. Unescaped / characters can appear within a character class. The empty character class [] matches no character at all, and its complement [^] matches any character, @@ -3045,10 +3045,13 @@ expression .%abc. If you intend the trailing context to be merely a, you must be careful to write (.%a)bc. Otherwise the trailing context is abc, and this means that the .% match will consume the longest string that does not contain "abc", when in fact what was intended was to consume the longest string that -does not contain a. For single-character trailing contexts, it may be a good -idea to use a complemented character class instead. That is to say, rather than -(.%a)bc, how about [^a]*bc. The set of strings which don't contain the -character a is adequately expressed by [^a]*. +does not contain a. The change in behavior of the % operator upon modifying the +trailing context is not as intuitive as that of the * operator, because the +trailing context is deeply involved in its logic. For +single-character trailing contexts, it may be a good idea to use a complemented +character class instead. That is to say, rather than (.%a)bc, consider +[^a]*bc. The set of strings which don't contain the character a is adequately +expressed by [^a]*. .SH NOTES ON FALSE |