小编Rob*_*arl的帖子

你在正则表达式中的意思是什么?

我遇到了这个代码,我不知道是什么u意思:

$todecode =~ s{
   %u([Dd][89a-bA-B][0-9a-fA-F]{2}) # hi
          %u([Dd][c-fC-F][0-9a-fA-F]{2})   # lo
        }{
     utf8_chr(
       0x10000_
       + (hex($1) - 0xD800) * 0x400_
       + (hex($2) - 0xDC00)
      )
        }gex;
Run Code Online (Sandbox Code Playgroud)

regex perl

-1
推荐指数
1
解决办法
372
查看次数

以下语法有何作用?

$temp =~ s/,//g
Run Code Online (Sandbox Code Playgroud)

这是什么语法?我在"学习Perl"一书中的任何地方都找不到它.有人能告诉我这应该做什么吗?

regex perl

-1
推荐指数
1
解决办法
132
查看次数

perl中的空格特征是什么

我想要这个输出

"type":"test test"
Run Code Online (Sandbox Code Playgroud)

我不想在命令中使用空格而不喜欢"".我希望有一个代表单个空格的角色,我知道我不能使用 \ s

有什么东西可以用吗?

print "\"type\":\"test(space character should be here )test\";
Run Code Online (Sandbox Code Playgroud)

perl space

-1
推荐指数
1
解决办法
3482
查看次数

使用String.Split()方法的Java异常:悬空元字符

我正在尝试解析URL字符串(我通过HTML Get方法接收)并提取嵌入的选项.我想知道它为什么会抛出异常s=s.split("?")[0];

Exception in thread "main" java.util.regex.PatternSyntaxException: Dangling meta character '?' near index 0

public static void main(String[] args) {
    String s= "run.html?yse=yse1&tracefile=capacity.1Mbps_c50.txt&fd=100&rd=100&down=1&up=1&per=0.00001";
    s=s.split("?")[0];  //drops error
    String ss[]=s.split("&");
//this is a class I have that receives the array of splitted options.
    JavaRunEmulator j = new JavaRunEmulator(ss);
    System.out.println(j.getOutput());
}
Run Code Online (Sandbox Code Playgroud)

java regex

-1
推荐指数
1
解决办法
4426
查看次数

如何在perl中的不同数组元素中存储不同行的文本文件

如何在perl中的不同数组元素中存储不同行的文本文件

例如文本文件包含

US
London
Run Code Online (Sandbox Code Playgroud)

如何将美国存储在数组[0]和伦敦数组[1]中

arrays perl file-io

-6
推荐指数
1
解决办法
651
查看次数

标签 统计

perl ×4

regex ×3

arrays ×1

file-io ×1

java ×1

space ×1