例如:<B>大aa司ss法,阿司法?费达阿斗!阿三大法的?</B>怎样通过正则表达式可以取的结果为:大aa司ss法,阿司法?费达阿斗!阿三大法的?

解决方案 »

  1.   

    以<b>或<B>开始,</b>或</B>结束,中间任意字符
      

  2.   

    String str=<B>jfiosafjadsiofus </B>
    Pattern p=<B>([^<>]*)</B>;
    Matcher m=p.compile(str);
    if(str.find())
      System.out.println(m.group(1))
      

  3.   

    import java.util.regex.*;public class Untitled5 {
        
    public Untitled5() {
        }
    public static void main(String para[]){    String regEx="[^(<B>)][^(</B>)]+";    String str="<B>大aa司ss法,阿司法?费达阿斗!阿三大法的?</B>";    Pattern p=Pattern.compile(regEx);    Matcher m=p.matcher(str);    System.out.println(m.find());    System.out.println(m.group());
        }
    }
      

  4.   

    thanks!
    bobking1983(bob-king)分数一定明天再给你,
    想在此在问一下就是:
      如果在delphi中,这个怎样实现?
      

  5.   

    1、<B>([^\\<]*)</B>
    2、<B>([\u0000-\uffff]+?)</B>

      

  6.   

    在delphi下<B>([^\\<]*)</B>是可以的
    thanks bobking1983(bob-king)和shaopin(shaopin)