symbian怪异问题集
1. 某些第三版用makesis any.pkg 出现unknown line的错误提示.解决方法: 在最结尾加分号.理由: 怪异问题,无理由2. 某些perl的版本不行. 将提示don't know how to make '""'(ActivePerl-5.6.0.611.msi就是这样)3. void OnDataRequest(const TDesC8& aInfoId, TInt aDirection)和函数void OnDataRequest(const TDesC8 aInfoId, TInt aDirection)的怪异区别, 前者对*iInfoId = aInfoId;这样的语句可以正确赋值, 而后者不可以.4. TTime 的 Set 函数中 日期的月份从0开始,而不是1月就是01,而是00, 所以20080911表示2008年10月
用perl 正则表达式处理文本(二)
注意: &&代替反斜线3. 合并操作 join $glue, @pieces 把@pieces数组合并,元素间加$glue字符串 例8. my $x = join ":", 4, 6, 8, 10, 12; # $x is "4:6:8:10:12" 例9. my $y = join "foo", "bar"; # gives just "bar", since no fooglue is needed my @empty; # empty array my $empty = join "baz", @empty; # no items, so it's an empty string 例10. my @values = split /:/, $x; # @values is (4, 6, 8, 10
用perl 正则表达式处理文本(一)
注意: 符号&&表示反斜线1. s/pattern/new string/ 文本替换. 把$_用模式pattern匹配,匹配到的用new string替换.成功替换返回true, 否则false例.1 $_ = "green scaly dinosaur"; s/(&&w+) (&&w+)/$2, $1/; # Now it's "scaly, green dinosaur" s/^/huge, /; # Now it's "huge, scaly, green dinosaur" s/,.*een//; # Empty replacement: Now it's "huge dinosaur" s/green/red/; # Failed match: still "huge
perl 的正则表达式匹配(二)
续一5. 变量匹配 a. 内置分组变量, 能保存小括号内的匹配值.而且是持久存储.直到下次成功匹配才改写分组变量 例. $_ = "Hello there, neighbor"; if (/(&&S+) (&&S+), (&&S+)/) { print "words were $1 $2 $3"; #$1==Hello, $2==there, $3==neighbor } b. 内置自动变量匹配. $` 匹配部分前面的部分 $&匹配部分, 是模式/pattern/ 中的所有内容,不同于$1, $2 $' 匹配部分后面的部分 c. 重复量词表达式 (string){a, b}匹配string的a到b次所
perl 的正则表达式匹配(一)
注意: 由于此blog不能显示反斜线,故用&&代替反斜线.1. Matches with m//.匹配操作(m/string/) 的简写形式 /string/, 也可以用m/string/的等价式m(string), m, m{string}, m[string],m,string,,m!string!,m^string^,等. 如果匹配,返回true,否则为false2. Matches Option Modifiersa. 大小写不敏感选项 /i如果没有/i,是大小写敏感的.print "Would you like to play a game? ";chomp($_ = );if (/yes/i) { # case-insensitive matchprint "In that case, I recommend that you go bowling.n";}b. 匹配任何字