ReplaceAll string by regular expression not work for this case.

I will delete all tag and want "pure text" but the output is delete all.
String content = "<aaa>pure text<fff>";
content = content.replaceAll("<.*>","");Content has output is blank because reqular expression match from begin and end of string
But when i change
String content = "<aaa>pure text<fff";
content = content.replaceAll("<.*>","");The output is ==> pure text<fff
How make req match in sequential
Please lead me to solution

peterdog1234 wrote:
Thank you very much.
I know '?' is a Quantifiers.
I do not understand using ?
Please lead me againSee the paragraph "Laziness Instead of Greediness" from [http://www.regular-expressions.info/repeat.html].

Similar Messages

  • Regular expression not working for adobe forms

    Hi,
    Iam using qtp for adobe forms and for some reason if i put in regular expression for apid value it doesn't recognise the object..there is nothing wrong with the regular expression as it is evaluated using regular expression evaluator in qtp 11.0....any ideas
    I got all the addins and everything and when i used regular expression for the top window it works but for any other object it doesn't

    Please try the code and see the problem. The regular expression is fine.
    I can replace the string with these and got results like this:
    import java.util.regex.Pattern;
    public class HtmlFilter implements TextFilter {
        private static String strTagPattern = "<\\s?(.|\n)*?\\s?>";
        private static int patternMode = Pattern.MULTILINE | Pattern.CASE_INSENSITIVE | Pattern.UNICODE_CASE | Pattern.CANON_EQ;
        private static Pattern tagPattern = Pattern.compile(strTagPattern, patternMode);
        public String filter(String t) {
              if(t==null || t.length()==0) return "";
            String ret = null;
            return tagPattern.matcher(t).replaceAll("");
         public static void main(String[] args) {
              System.out.println(new HtmlFilter().filter(null));
              System.out.println(new HtmlFilter().filter(""));
              System.out.println(new HtmlFilter().filter("<P>abc def</P>"));
              System.out.println(new HtmlFilter().filter("<P>&#25105;&#22269;&#30707;&#27833;&#20379;&#24212;&#23433;&#20840;&#31995;&#32479;&#24433;&#21709;</P>"));
    }The results are
    abc def
    ????????????

  • Regular expression not working for String.split()?

    hi, i have a String variable called 'table'.
    It has a bunch of chunks of data seperated by whitespace, whether it
    be spaces or carraige returns. Anyways, i want to split this up using
    the String.split function. i want to split it around whitespace.
    here is my code:
    String codes[] = table.split("\s");
    However, i'm getting back all nulls in the codes variable. What am i doing wrong?
    thanks

    split("\\s")\ is special both in Java String literals and in regex, so you need two of them.
    You'll probably also have to take an extra step it you don't want regex to stop at newlines. I forget the details, so check the docs.

  • I started the OS system from a backup hard drive. Now My Adobe products doesnt work. "the licensing does not work for this product" Error code 150:30. Help me please!!

    I started the OS system from a backup hard drive. Now My Adobe products doesnt work. "the licensing does not work for this product" Error code 150:30. Help me please!!

    Reinstall the software properly. migration/ backups do not work due to the specific requirements of the activation system.
    Mylenium

  • I've moved my Aperture library to another computer, and masters are referencing an old path name.  How can I update these references?  Reloctating masters does not work in this case :(

    I've moved my Aperture library from one computer to another using Finder.
    I merged the library with one which was already on the computer.
    Now, the photos I imported have reference to the old path name on my old computer.
    How can I update these references as "Relocate Masters" does not work in this case?

    Just one suggestion to be able to reconnect all at once:
    Create a smart album containing the images with missing masters:
    File -> New ->  Smart Album,     and add a rule: File Status is "Missing"     (or File Status is "offline")
    Then select the images in this album and go to the File menu:
    and select:   File -> Locate referenced File
    If you are lucky, Aperture will reconnect all at once, if you point the first image version to its counterpart.

  • CFFORM (Flash) Validation with Regular Expressions Not Working

    I am having troubles getting regular expression validation to
    work in a CFFORM. The below code is an extract of a much larger
    form, the first name and last name have a regular expression
    validation...and it doesn't work!
    I'd appreciate any comments/info for help on this, have
    searched high and low on information to get this working...but no
    joy.
    The code is:
    <cffunction name="checkFieldSet" output="false"
    returnType="string">
    <cfargument name="fields" type="string" required="true"
    hint="Fields to search">
    <cfargument name="form" type="string" required="true"
    hint="Name of the form">
    <cfargument name="ascode" type="string" required="true"
    hint="Code to fire if all is good.">
    <cfset var vcode = "">
    <cfset var f = "">
    <cfsavecontent variable="vcode">
    var ok = true;
    var msg = "";
    <cfloop index="f" list="#arguments.fields#">
    <cfoutput>
    if(!mx.validators.Validator.isValid(this,
    '#arguments.form#.#f#')) { msg = msg + #f#.errorString + '\n';
    ok=false; }
    </cfoutput>
    </cfloop>
    </cfsavecontent>
    <cfset vcode = vcode & "if(!ok)
    mx.controls.Alert.show(msg,'Validation Error'); ">
    <cfset vcode = vcode & "if(ok) #ascode#">
    <cfset vcode =
    replaceList(vcode,"#chr(10)#,#chr(13)#,#chr(9)#",",,")>
    <cfreturn vcode>
    </cffunction>
    <cfform name="new_form" format="flash" width="600"
    height="600" skin="halosilver" action="new_data.cfc">
    <cfformgroup type="panel" label="New Form"
    style="background-color:##CCCCCC;">
    <cfformgroup type="tabnavigator" id="tabs">
    <cfformgroup type="page" label="Step 1">
    <cfformgroup type="hbox">
    <cfformgroup type="panel" label="Requestor Information"
    style="headerHeight: 13;">
    <cfformgroup type="vbox">
    <cfinput type="text" name="reqName" width="300"
    label="First Name:" validate="regular_expression" pattern="[^0-9]"
    validateat="onblur" required="yes" message="You must supply your
    First Name.">
    <cfinput type="text" name="reqLname" width="300"
    label="Last Name:" validate="regular_expression" pattern="[^0-9]"
    validateat="onblur" required="yes" message="You must supply your
    Last Name.">
    <cfinput type="text" name="reqEmail" width="300"
    label="Email:" validate="email" required="yes" message="You must
    supply your email or the address given is in the wrong format.">
    <cfinput type="text" name="reqPhone" width="300"
    label="Phone Extension:" validate="integer" required="yes"
    maxlength="4" message="You must supply your phone number.">
    </cfformgroup>
    </cfformgroup>
    </cfformgroup>
    <cfformgroup type="horizontal"
    style="horizontalAlign:'right';">
    <cfinput type="button" width="100" name="cnt_step2"
    label="next" value="Next"
    onClick="#checkFieldSet("reqName,reqLname,reqEmail,reqPhone","new_form","tabs.selectedInd ex=tabs.selectedIndex+1")#"
    align="right">
    </cfformgroup>
    </cfformgroup>
    </cfformgroup>
    </cfformgroup>
    </cfform>

    quote:
    Originally posted by:
    Luckbox72
    The problem is not the Regex. I have tested 3 or 4 different
    versions that all work on the many different test sites. The
    problem is it that the validation does not seem to work. I have
    changed the patter to only allow NA and I can still type anything
    into the text box. Is there some issue with useing Regex as your
    validation?
    Bear in mind that by default validation does not occur until
    the user attempts to submit the form. If you are trying to control
    the characters that the user can enter into the textbox, as opposed
    to validating what they have entered, you will need to provide your
    own javascript validation.

  • Airport Express not working for MacBook Air, ok for iMac

    I connect to the internet via wireless broadband; the ethernet cable from the broadband antenna plugs into my Airport Express router.  I run both my 27" iMac desktop and my 13" Mac Book Air off the Airport Express router.  To the best of my knowledge, nothing has changed with my internet provider's settings.
    Since Friday, the MacBook Air internet connection barely works; if a page loads, it takes forever (and I have a very fast broadband connection.)  Checking the same connection on the iMac has no delay and loads instantly.  On the laptop, if the page does load, and I click a link on that page, the link takes me to a new page requesting me to log in to my internet provider, or just fails to load.  I get lots of "page failed to load; interneet connection was reset....".
    I have checked network settings on both machines and they appear to be just fine.  I have run diagnostics and it shows everything working fine.
    I ran Disk Utility (permissions repair and verify disk) and have no problems.
    I have tried restarting the laptop several times.
    Software is up to date.
    I don't think it's the internet server or the connection since it's working on the desktop Mac.
    I'd appreciate any suggestions or things to try; I read about doing soft and hard resets but am reluctant to try that since Airport is working for the desktop computer just fine.

    I have a MacBook Pro Retina display: 15.4-inch late 2015 with OS X Mavericks install, only on second week. 
    Insight works on FaceTime, Skype, but yahoo program does not show insight cam in dropped down.
    Now when I got my new MacBook Pro, I down loaded all new Skype (worked tested), FaceTime (Worked Tested), Yahoo (not worked)
    Fix:
    With the new Maverick you have to use there messager program Version 8.0 (4218). Once I add my yahoo account video works again.
    It also supported AOL, AIM, Google Talk, Jabber.
    Guess I miss it frist time... hope this helps...

  • Adobe AIR for Android as3 codes not working for this one project

    I'm trying to use Accelerometer in my flash game, which works for every other project I'm working on, but for some reason on this one project if I try using it I get errors, using the same code i've used before, such as this. 
    1046: Type was not found or was not a compile-time constant: Accelerometer.
    1180: Call to a possibly undefined method Accelerometer. 
    This is a fairly old file, not that old, so are there files I need to add to it to get it to work, or settings I need to change? This is very frustrating, I don't know what the problem possibly could be. Can anybody help me?

    The error message is indicating it cannot find the class.  Make sure you are importing it:
         import flash.sensors.Accelerometer;

  • BAPI_SALES_CREATEFROMDAT1 is not working for following case

    dear friends,
          I have created a function module for creating sales order in BSP page. Because i dont want to include all the structure in BW system. so i just pass required parameters and i will only sales order from that function module. so when i can call that function module without create unnecessary structure in BW system. But i m facing one problem. If i test that function module in R3 system at that time it is running properly in the case if i enter data in selection screen only. but if do in following way then i m not able to create sales order. I find out even problem. The problem is that if i see after executing function module if see the table zpartner in output screen then the partner function is being changed. I am passing it as "SP" but in zpartner table of output screen it is like 'CR'. so sales order doesnt get created. Give me proper solution for this. and if this is not the proper way then please tell me proper way so that i can do.
    thanks in advance.
    FUNCTION ZSALESCREATE1.
    ""Local interface:
    *" IMPORTING
    *" VALUE(DOC_TYPE) LIKE BAPISDHD1-DOC_TYPE OPTIONAL
    *" VALUE(DIVISION) LIKE BAPISDHD1-DIVISION OPTIONAL
    *" VALUE(DISTR_CHAN) LIKE BAPISDHD1-DISTR_CHAN OPTIONAL
    *" VALUE(SALES_ORG) LIKE BAPISDHD1-SALES_ORG OPTIONAL
    *" VALUE(MATERIAL) LIKE BAPISDITM-MATERIAL OPTIONAL
    *" VALUE(PARTN_ROLE) LIKE BAPIPARNR-PARTN_ROLE OPTIONAL
    *" VALUE(PARTN_NUMB) LIKE BAPIPARNR-PARTN_NUMB OPTIONAL
    *" EXPORTING
    *" VALUE(SALES) LIKE BAPIVBELN-VBELN
    *" TABLES
    *" ZORDER STRUCTURE BAPISDHD1
    *" ZITEM STRUCTURE BAPISDITM
    *" ZPARTNER STRUCTURE BAPIPARNR
    ZORDER-DOC_TYPE = DOC_TYPE.
    ZORDER-SALES_ORG = SALES_ORG.
    ZORDER-DISTR_CHAN = DISTR_CHAN.
    ZORDER-DIVISION = DIVISION.
    APPEND ZORDER.
    ZITEM-MATERIAL = MATERIAL.
    APPEND ZITEM.
    ZPARTNER-PARTN_ROLE = PARTN_ROLE.
    ZPARTNER-PARTN_NUMB = PARTN_NUMB.
    APPEND ZPARTNER.
    CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT2'
    EXPORTING
    ORDER_HEADER_IN = ZORDER
    IMPORTING
    SALESDOCUMENT = SALES
    TABLES
    ORDER_ITEMS_IN = ZITEM
    ORDER_PARTNERS = ZPARTNER
    EXCEPTIONS
    OTHERS = 1.
    COMMIT WORK.
    ENDFUNCTION.

    Add the highlighted portion in the below code to your function. It will solve the issue. This is not BSP related question. Better place for this question would be ABAP forum.
    FUNCTION ZSALESCREATE1.
    *"*"Local interface:
    *" IMPORTING
    *" VALUE(DOC_TYPE) LIKE BAPISDHD1-DOC_TYPE OPTIONAL
    *" VALUE(DIVISION) LIKE BAPISDHD1-DIVISION OPTIONAL
    *" VALUE(DISTR_CHAN) LIKE BAPISDHD1-DISTR_CHAN OPTIONAL
    *" VALUE(SALES_ORG) LIKE BAPISDHD1-SALES_ORG OPTIONAL
    *" VALUE(MATERIAL) LIKE BAPISDITM-MATERIAL OPTIONAL
    *" VALUE(PARTN_ROLE) LIKE BAPIPARNR-PARTN_ROLE OPTIONAL
    *" VALUE(PARTN_NUMB) LIKE BAPIPARNR-PARTN_NUMB OPTIONAL
    *" EXPORTING
    *" VALUE(SALES) LIKE BAPIVBELN-VBELN
    *" TABLES
    *" ZORDER STRUCTURE BAPISDHD1
    *" ZITEM STRUCTURE BAPISDITM
    *" ZPARTNER STRUCTURE BAPIPARNR
    <b>CALL FUNCTION 'CONVERSION_EXIT_PARVW_OUTPUT'
      EXPORTING
        input         = PARTN_ROLE "(SP)
    IMPORTING
       OUTPUT        = PARTN_ROLE . "(CR)</b>
    ZORDER-DOC_TYPE = DOC_TYPE.
    ZORDER-SALES_ORG = SALES_ORG.
    ZORDER-DISTR_CHAN = DISTR_CHAN.
    ZORDER-DIVISION = DIVISION.
    APPEND ZORDER.
    Regards
    Raja
    Since you are new to the forum have a look at the following weblog.
    /people/mark.finnern/blog/2004/08/10/spread-the-love

  • Changing playback quality to 1/4 does not work for this one clip...

    So, I've recently ran into a really annoying problem when editing one of my videos, even though I click the 1/4 playback quality, this one clip still plays in full. My recording setup has not changed, I still and have always been using my iPod Touch and this is the first time I encountered this

    It's likely that the resolution of the footage from the iPod Touch is much higher than the rest of your clips. In this case, the other clips will appear to be much more pixelated than the one from the iPod when you turn down the playback resolution.
    Rest assured that the iPod footage is being affected by the resolution setting, even though it might not be as visually obvious as the other clips.

  • TS2755 I used to get iMessages on my iPad 2 and iPhone 4 now it goes to one or the other, not both.  Icloud is not working for this and iMessage texting doesn't work I need to send it as a regular text. How do I fix this issue.

    Icloud doesn't work between my iPad 2 and iPhone 4. And when I try to iMessage from my iphone 4 it doesn't send. I need to send it as a regular text message. Any ideas why they won't sync and iMessage won't send?

    To delete, tap "Edit" (tap to enlarge image)

  • Flash player not working for this site

    Hi All,
    When I am at the site down in this message, my flash isn't
    loading and it is asking for flash download. only in IE in firefox
    it's working ok. Do you have any suggestions?
    The site is
    www.nedfinity.com

    There is no problem with SWFObject. It's loads better than
    the default
    settings - aka Adobe's script. Which is why Adobe uses
    SWFObject on their
    own page.
    Dave -
    www.offroadfire.com
    Head Developer
    http://www.blurredistinction.com
    Adobe Community Expert
    http://www.adobe.com/communities/experts/

  • To_number is not working for this??

    any idea.. it's 10g
    select to_number(trim(' 3020     '))
    from dual;
    ORA-01722: invalid number

    I think you have TAB space in your string.
    SQL> select length(trim('  3020                                  '))
    f  2  rom dual;
    LENGTH(TRIM('3020'))
                       5
    SQL> select length(replace('  3020                                       ',' ','
    ')) from dual;
    LENGTH(REPLACE('3020','',''))
                                5
    SQL> select replace('  3020                                      ',' ','') from
    dual;
    REPLA
    3020
    SQL> select trim('1<TAB SPACE>') from dual;
    TR
    1
    SQL>
    SQL> select length('1<TAB SPACE>') from dual;
    LENGTH('1')
              2
    SQL> select length(trim('1<TAB SPACE>')) from dual;
    LENGTH(TRIM('1'))
                    2So remove the TAB space from the string and it will work fine
    Message was edited by:
    tekicora

  • Enabled cookies, but not working for this specific site...

    I was trying to log in to milwaukeejobs.com, but then it takes me to a page which says, "If you have tried to log in, but are being redirected to this page. It may be because cookies are not enabled on your computer." I made sure my cookies were enabled (I have "accept cookies from sites" and "accept third-party cookies"), but I still can't log in. I tried logging into my milwaukeejobs.com account from another browser (Safari) and that worked so it's not a problem with my account. It is firefox. I didn't have a problem with this until I upgraded to firefox 4. Please help! Thanks so much.

    Had the same problem with a different website. Solved by doing this:
    # Clean browsers cookies and cache
    # Go to the specific login/registration page that didn't work. Make sure it is http://'''www'''.site.com and NOT just http://site.com
    # Login/register

  • Safari do not work for this "Discussions"

    Yes. I've try a lot of times, but when login to participate, Safari send me to suscribe a new count in an infinite loop.
    This problem not happens with Firefox (I'm using it now fot get write this post). Fire fox get login me without a problem.
    Anyone have the same problem?
    I'm using the last version of Safari (3.2.3)

    Hi,
    Do you have any accented characters in your full name? If you do, there's an issue with Safari and Discussions that causes this bug. To fix it, you need to change the accented characters to unaccented ones.
    You can adjust your full name under the Email section at http://myinfo.apple.com

Maybe you are looking for

  • How to add an if statement in jsp?

    Hi all, I have a displayTag table and wonder how to have a condition on the following code:   <display:column title="Accept?">             <html:multibox property="select" value = "<%=bean.toString() %>" />            </display:column>Basically, I wo

  • Can no longer delete files from Time Machine

    My Gear icon in Time Machine that allowed me to delete all copies of a file, has disappeared -- as has the magnifying glass. Any one else lost this?

  • How do I combine two FLVs into a split frame single player?

    Hello. I want to know how to duplicate the functionality on http://www.vcasmo.com There is what appears to be a single flash player, but two separate FLVs (one video, and one PPT). The PPT is synced to the video based on timing settings created when

  • Easiest way: installing leopard on ibook

    hi, i got a ibook g4 (1.33ghz,1.25gb,cd-r/w) from a friend and im looking for the easiest way to upgrade the os to leopard. i found several ways in the inet, but none of them sounds quite easy or cheap (e.g. runninga tftp server, changing the interna

  • Trouble with a new format

    OK heres the skinny. I have several sytems and I am having trouble with one in particular. I was running this KT4V with a barton 2500+ and 1 gig of 2100 DDR. I couldnt put 1 gig of 3200 DDR in because of board limitations. I also has a 170o+ "b" chip