由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Java版 - Java Regular Expression Question
相关主题
return null or empty list/set/...EJB2 Question
请教 class cast problem1 quick interview question
Re: Regular Expression in Javawhat is your opinion in this case?
谁用过JAVA1.4带的REGULAR EXPRESSION PACKAGE吗对 spring 的 exception 处理方式真是不适应
[转载] Java Regular Expression Question //bow !其实有很多概念都是误导性的
Re: [转载] Java Regular Expression QuestioEJB ConnectionFactory issue
Regular Expression question: how to enumerate all matches?Re: How can I call another program from Java?
请教String.split的regular expressionJava runtime?
相关话题的讨论汇总
话题: java话题: varname话题: expression话题: regular话题: string
进入Java版参与讨论
1 (共1页)
T*****e
发帖数: 361
1
In Perl, separating words with mixed caps in an identifier
like "RuntimeException" as "Runtime Exception" is fairly
easy. The regular expression for this can be:
$varName =~ s/([A-Z])/ \1/g;
or even better:
$varName =~ s/([^A-Z])([A-Z])/\1 \2/g;
$varName =~ s/([A-Z])([A-Z][a-z])/\1 \2/g;
Java's regular expression is pretty close to that of Perl
in term of searching for a pattern. However, can we do
similar replacement in Java without having to write a loop
to do searching and manua
m******t
发帖数: 2416
2
String.replaceAll()?
T*****e
发帖数: 361
3
I guess not if I understand it correctly.
String.replaceAll(String regex, String replacement)
The first parameter is for pattern searching, but the replacement
is simply a plain string and backreference does not work.

【在 m******t 的大作中提到】
: String.replaceAll()?
T*****e
发帖数: 361
4
I guess not if I understand it correctly.
String.replaceAll(String regex, String replacement)
The first parameter is for pattern searching, but the replacement
is simply a plain string and backreference does not work.

【在 m******t 的大作中提到】
: String.replaceAll()?
1 (共1页)
进入Java版参与讨论
相关主题
Java runtime?[转载] Java Regular Expression Question //bow !
Re: 怎么能是JAVA里的数组开的更大?Re: [转载] Java Regular Expression Questio
Re: The real RiskRegular Expression question: how to enumerate all matches?
Re: unix环境下如何在java程序中执行命令行?请教String.split的regular expression
return null or empty list/set/...EJB2 Question
请教 class cast problem1 quick interview question
Re: Regular Expression in Javawhat is your opinion in this case?
谁用过JAVA1.4带的REGULAR EXPRESSION PACKAGE吗对 spring 的 exception 处理方式真是不适应
相关话题的讨论汇总
话题: java话题: varname话题: expression话题: regular话题: string