[oracle@localhost ~]$ cat tmpperl01
#!/usr/bin/perl
$_ = "The year 1752 lost 10 days on the 3rd of September";
while (/(\d+)/g)
{
print pos($_),"\n";
}
print pos($_)."---","\n";
while (/e/g)
{
print pos($_),"\n";
}
print pos($_)."---","\n";
[oracle@localhost ~]$ cat tmpperl02
#!/usr/bin/perl
$_ = "The year 1752 lost 10 days on the 3rd of September";
while (/(\d+)/cg)
{
print pos($_),"\n";
}
print pos($_)."---","\n";
while (/e/cg)
{
print pos($_),"\n";
}
print pos($_)."---","\n";
[oracle@localhost ~]$ ./tmpperl01
13
21
35
---
3
6
33
43
46
49
---
[oracle@localhost ~]$ ./tmpperl02
13
21
35
35---
43
46
49
49---#增加/c修饰符在匹配失败后不重置pos的位置
perl中while修饰符/c参数
转载
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
C#中默认访问修饰符
如果被问到C#中默认的访问修饰符是什么?你该怎么回答,是不是感觉不太
C# 访问修饰符 程序集 命名空间 -
kingbase 数据库模式mysql
管理内存涉及维护和变更数据库实例中各项内存结构的大小,以适应数据库的相关需要。关于内存管理需要被管理的内存结构是指系统全局区(简写为SGA)和实例进程全局区(简写为PGA)。KingbaseES数据库支持以配置参数的形式设置内存区域的大小。内存结构概述了解KingbaseES数据库基础的内存结构。手动配置内存当你希望对单个内存组件的大小进行直接的控制时,可以手动配置和调整内存组件。1. 关于内存管
kingbase 数据库模式mysql 数据库 kingbase 金仓数据库 Powered by 金山文档