1
# From denis@gissoft.eu Thu May 29 09:10:18 IDT 2014
2
# Article: 8408 of comp.lang.awk
3
# X-Received: by 10.182.128.166 with SMTP id np6mr93689obb.16.1401289466734;
4
# Wed, 28 May 2014 08:04:26 -0700 (PDT)
5
# X-Received: by 10.140.36.6 with SMTP id o6mr4939qgo.26.1401289466607; Wed, 28
6
# May 2014 08:04:26 -0700 (PDT)
7
# Path: eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!news.glorb.com!c1no19185457igq.0!news-out.google.com!qf4ni13600igc.0!nntp.google.com!c1no19185454igq.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail
8
# Newsgroups: comp.lang.awk
9
# Date: Wed, 28 May 2014 08:04:26 -0700 (PDT)
10
# In-Reply-To: <lm4rra$4u9$1@dont-email.me>
11
# Complaints-To: groups-abuse@google.com
12
# Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=82.131.35.51; posting-account=zNhVLgoAAACsg-WfVe_or2VV7loUhx8H
13
# NNTP-Posting-Host: 82.131.35.51
14
# References: <3112e356-d2e1-45cd-ba55-2f939ee50105@googlegroups.com>
15
# <lm34d7$tb4$1@news.m-online.net> <f666871f-a94c-4505-9677-8711d656433c@googlegroups.com>
16
# <lm4rra$4u9$1@dont-email.me>
19
# Message-ID: <79828a24-d265-4e88-8de1-e61ecbaa6701@googlegroups.com>
20
# Subject: Re: \0 character can't be implement inside regexp in some cases?
21
# From: Denis Shirokov <denis@gissoft.eu>
22
# Injection-Date: Wed, 28 May 2014 15:04:26 +0000
23
# Content-Type: text/plain; charset=ISO-8859-1
24
# Xref: news.eternal-september.org comp.lang.awk:8408
27
# All of the other use-cases just cluttered up your posting.
31
# 1. where in the Janis code the case with the `switch-case'?
32
# 2. how do you know about that there is only two cases? may be you know it because my code contains the other test cases?
33
# 3. fine. do you know what situation with the dynamic regexps? no?
34
# 4. do you know what situation with RS,FS and /.../ in the middle-area? how you can say that there is only two cases if you absolutely do not know it?
36
# i'm asking: WHO will perform testing other cases? You? gawk-team? the God?
37
# what is that point of view: that it will be enough to say:
38
# Oh! my match(t,/^\0$/) is matching "\x00" but t~/^\0$/ is not. why oh why?
40
# where is the test cover? or you think that other peoples will doing its instead of You? instead of Me?
42
# and the second point: guys you are screaming about two levels of stack. really, you kidding? =)
44
# however, i'm attaching some additional information about dynrexp:
47
_ch("match()",match(t,r))
48
_ch("split()",split(t,A,r)>1)
49
_ch("patsplit()",patsplit(t,A,r))
50
_ch("gsub()",gsub(r,"&",t))
51
t2=t; _ch("sub()",sub(r,"&",t2))
52
_ch("gensub()",!gensub(r,"","G",t))
54
# switch-case is not applicable with dynrxp
58
print substr(fn ": ",1,16) (bool ? "+" : "-") }
61
print "__________________________"; print }
63
BEGIN{ _chmd("\x01","^\1$") #testing that all doings right; all match
64
_chmd("\x00","^\1$") #testing that all doings right; all not match
65
_chmd("\x00","^\0$") #tesing dynrexp
77
# __________________________
86
# __________________________
96
# it's looks like with the dynamic regexp the same story.
98
# i found another one moment that is possible near with the reason of this issue:
100
# i was testing what characters can be present in doublestring and regexp "directly" (just as the character) and what characters must be present as escape sequence (\qqq)
102
# so, i found the following:
105
# if ( match(t,/^abc[NUL]def/) ) ... - where [NUL] is the character \x00
107
# it's seems that in that case the regular expression is processed until [NUL]character and the other part is ignored because the example above gives TRUE