package test;
public class JButtonTest
{
public static void main ( String[] args )
{
String regex = "[\\s\\S]+\\]+\\>([^\\<]+)\\<\\/property\\>[\\s\\S]*";
String input = "\r\nprojectNo\r\n \r\n\r\n projectNo\r\n \r\n\r\n 项目编号\r\n \r\n";
System.out.println (input.replaceAll (regex, "$1"));
}
}
Java代码
iv=(ImageView)this.findViewById(R.id.iv);
iv.setTag("toRight");
iv.setOnClickListener(listener);
ani_0 = new TranslateAnimation(
Animation.RELATIVE_TO_PARENT, 0.0f, Animation.RELATIVE_TO_PARENT, -1.0f,
Animation.RELATIVE_TO_SELF, 0.0f, Animation.RELATIVE_TO_SELF, 0.0f);
ani_1= new TranslateAnimation(
Animation.RELATIVE_TO_PARENT, -1.0f, Animation.RELATIVE_TO_PARENT, 0.0f,
Animation.RELATIVE_TO_SELF, 0.0f, Animation.RELATIVE_TO_SELF, 0.0f);
ani_0.setInterpolator(new AccelerateDecelerateInterpolator());
ani_0.setDuration(1000);
ani_0.setFillEnabled(true);
ani_0.setFillAfter(true);
ani_0.setAnimationListener(animationListener);
ani_1.setInterpolator(new AccelerateDecelerateInterpolator());
ani_1.setDuration(1000);
ani_1.setFillEnabled(true);
ani_1.setFillAfter(true);
你好:
正则可以这样写
pattern = Pattern.compile("[\\s\\S]*?name=\"label\">(.*?)[\\s\\S]*?");
转成xml就简单多了。