How about the statement of regular expression like for this

I what to get varians String array by one regular express for the statement like:
${user} like play ${game} in ${date}
I want to get String[] as {"user","game","date"} by one regex, by str.split(regex). I tried many times but always fail to get the result I expected. May it be possible to meet the destination?
thanks in advance
Frederick

why StringBuffer was using here?So one could split the pattern into multiple lines. But it just occurred to me that one could just use string concatenation, which would look better. I don't know why I bothered to use StringBuffefer.
e.g.:
String pattern =
    "^" +           // the start of a string
    "(dog)|(cat)" + // match either "dog" or "cat" at the start of the line
    "\\s*" +        // match an arbitrary amount of whitespace
    "$";            // but don't allow anything other than whitespace after dog or cat
Pattern p = Pattern.compile(pattern);
Pattern p = Pattern.compile("^(dog)|(cat)\\s*$");> isn't this look more simpler and better?
In this case, yes. I was looking for a way to make regexps more explicit, with whitespace and comments, for more complicated cases.
But those double quotes and plus signs add ugliness of their own, so a regexp would have to be pretty complex before it would be an improvement.

Similar Messages

  • How to use regular expression replace for this special characters?

    hi,
    I need to replace the below string, but i couldnt able to do if we use the special charaters '+', '$' . can anyone suggest a way to do this?
    select REGEXP_REPLACE('jan + feb 2008','jan + feb 2008', 'feb',1,0,'i') from dual
    anwers should be :- feb

    you should use escape character \.
    the regular expression will look like as follows:
    select REGEXP_REPLACE('jan + feb 2008','jan \+ feb 2008', 'feb',1,0,'i') from dual
    hope this is what you needed.
    cheers,
    Davide

  • What would the best process chain look like for this MD data load scenario?

    Hi there,
    I have the following setup. SAP BW connection to external system via DBConnect (DB2 database).
    We have 73 master data text data sources to load either once a week or everyday through process chain. We have not decided on the exact schedule yet.
    All the master data text DataSources pull data from the SAME VIEW created on the DB2 external system:
    VWDEDMASTERDATA
    The structure of the view is the following:
    DEDNAME
    DEDNAMETYPE
    DEDNAMECODE
    DEDNAMEDESC
    DEDNAMELONGDESC
    So, everytime master data text is extracted for all the 73 objects it queries the same view over and over again VWDEDMASTERDATA. We only differentiate in the datasource on the FIELDS tab which InfoObject should DEDNAME map to and then in InfoPackage we filter on the exact object/field to query.
    So essentially, every time we run InfoPackage for master data text object the external system gets queried in the following way:
    SELECT * from VWDEDMASTERDATA where DEDNAME = [FIELD/InfoObject specified in InfoPackage]
    So, if I have to have all 73 objects loaded, essentially the same SQL statement has to execute 73 times. In this scenario, what would be the proper process chain setup that has perfomance in mind? How should the InfoPackages be arranged, in parallel, sequentially, how many in a row, etc?
    Let me know if you need more information.
    thanks

    They would like to send the letters to me
    Depending upon how they send the letters to you and how they expect Acrobat to convert them you could be bordering on a license violation that prohibits you from using your version of Acrobat as a server-based product.
    Adobe offers server based products to convert rtf files into pdf files. Some require your company to run a server, but one seams exactly what they may want. The createpdf service is run by Adobe and seems capable of doing what your company wants.
    https://www.acrobat.com/createpdf/en/home.html

  • How would a calc all script look like for this outline

    I understand that
    When you perform a default calculation (CALC ALL) on a database, Essbase calculates the dimensions in this order:
    If both a dimension tagged as accounts and a dimension tagged as time exist, and if formulas are applied to members on the accounts dimension, Essbase calculates in this order:
    Dimension tagged as accounts
    Dimension tagged as time
    Other dense dimensions (in the order in which they are displayed in the database outline)
    Other sparse dimensions (in the order in which they are displayed in the database outline)
    Otherwise, Essbase calculates in this order:
    Dense dimensions (in the order in which they are displayed in the database outline)
    Sparse dimensions (in the order in which they are displayed in the database outline)
    but what would the calc srcipt look like for the below outline
    Dense 1 = 1822 (Accounts)
    Dense 2 = 32 (Periods)(Time)
    Sparse 1 = 12
    Sparse 2 = 10
    Sparse 3 = 17
    Sparse 4 = 21
    Sparse 5 = 22
    Sparse 6 = 7
    Sparse 7 = 79
    Sparse 8 = 761
    Sparse 9 = 1081
    Sparse 10 = 12140
    Thanks in advances
    Edited by: Next Level on May 18, 2012 1:43 AM

    No need to get excited, especially as you have already answered the question.
    As you wrote:
    If both a dimension tagged as accounts and a dimension tagged as time exist, and if formulas are applied to members on the accounts >>dimension, Essbase calculates in this order:
    Dimension tagged as accounts
    Dimension tagged as time
    Other dense dimensions (in the order in which they are displayed in the database outline)
    Other sparse dimensions (in the order in which they are displayed in the database outline)So Essbase will calculate, in listed order, the following dimensions:
    Accounts
    Period
    Years
    Subledger
    Company
    Region
    Division
    Ledger
    MfgCenter
    Business Center
    SubLedger
    As I and others have written, doing a CALC ALL on the above is not a great idea for a variety of reasons and I personally think this could likely be done pretty easily as an ASO database, but that's with just a hint as to what your requirements are.
    If you don't believe me (and I suggest that you do not for your edification) the above calc order is really easy to test. Create a copy of the database, clear it out, find one level zero intersection for all dimensions and do a lock and send/submit to get one block of data. Use the following commands in a calc script: SET UPDATECALC OFF; SET AGGMISSG ON ; SET MSG DETAIL ; CALC ALL ; That will show you (quickly) exactly what and in what order the database gets calculated. Just take a look at the application log.
    Regards,
    Cameron Lackpour

  • My website was hacked, I made a new one and placed it on a new server. How about the red warning page on firefox for returning visitors?

    Hi I have a problem. My businesswebsite www.steunkousgemak.nl was hacked and the hacker placed mallware on it. My link on google had a warning and when you wanted to visit my site on firefox there was a red warning page. I made a new website so it's deffinately clean, moved it to a different server and have a new hostingpackage. Now I am wondering if firefox automaticly saved the warning for all visitors that where on my website when it was infected, and so that they still see the warning when they want to visit my site now? if yes, how can I solve this?thank you a lot for your answer!regards Steven

    Try clearing your browser cache.
    Tools > Clear Recent History... - hit Details and make sure only Cache is selected, then select Everything and hit the Clear Now button.

  • How to specify ");" as a regular expression in split method of String class

    How to specify ");" as a regular expression in split method of String class using delimeters?

    Sorry, you can't specify that by using delimiters. Mostly because this requirement makes no sense.
    Do you rather need "\\);"?

  • How find the missing glyph using javascript [like indesign preflight], and replace same glyph available font or

    The situation:
    I want to use basetext font, but some of the glyphs are missing in it, and are highlighted with pink boxes. common font [stix, etc.] have much more glyphs than basetext font. I can apply common font [stix, etc.]manually for each of the missing glyphs or insert two character and use kerning set it up, but it is tedious.
    Question:
    How find the missing glyph using javascript [like indesign preflight], and replace same glyph available font or insert two character and use kerning set it up?
    Any one know how to do this?
    Thanks in Advance,
    ~Jack

    Try Peter kehrl's script
    http://www.kahrel.plus.com/indesign/missing_glyphs.jsx

  • HT201301 how about the Chinese language doc. Able to use with the My Lyric Book program?

    how about the Chinese language doc. Able to use with the My Lyric Book program?

    I'm not sure where you see that the links I gave suggested that. The iPhoto link (quoted below) in step 4 suggests dragging the library to the new location. You can do that in Finder by dragging the library to the external disk in the Finder sidebar. If you don't have a sidebar in Finder, go to the Finder View menu and click Show Sidebar. If the external disk isn't visible in the sidebar, go to the Finder Preferences, click Sidebar at the top of the Preferences window, and put a checkmark in front of External disks in the Devices section.
    You can move your entire iPhoto library to a different computer, a hard disk, or another location on your computer.
    Important:    Before you move your iPhoto library, it’s a good idea to back it up to a DVD or external hard disk.
    Move your iPhoto library
    If you’ve created multiple photo libraries, be sure to move only the library currently displayed when iPhoto is open. To move a different library, you first need to switch to it.
    Quit iPhoto.
    In the Finder, choose your home folder (it’s usually named after you).
    Open the Pictures folder (in the home folder) to locate the iPhoto Library file.
    Drag the iPhoto Library file to a new location on your computer.
    Open iPhoto.
    In the window that appears, select the library you want, and then click Choose.

  • Help, How about the price about the computer components in Toronto

    help, How about the price about the computer components (CPU,
    RAM and so on...) shall I bring CPU and RAM to Toronto?
    I am Chinese. I live in shanghai...
    And, are there some websites which provide computer hardware price information?
    I really appreciate your help.

    Check out some of the major retailers for a general idea:
    www.futureshop.ca
    www.staples.ca

  • Where could i find information about the state of my request to change my ipod nano 1st gen?

    my ipod 1st gen is part of the program of replacement, but i dont know where i can find information about the state of my request. some ideas?   

    You can enter the Serial Number and Repair ID on this page to get a stsus update:
    https://selfsolve.apple.com/repairstatus/main.do;jsessionid=0phLTksW2mwLbyQVF3Qs zFtCQMH2Jv5xkMxvMlD6RsKVLhpJjpjj!846893301
    Hope that helps!

  • I have 2 apps that have been waiting to update for a week.  I don't really care about the update, I would just like to use them, but the are stuck waiting.  I have tried powering down, syncing with my computer...all fails.  Any ideas?

    I have 2 apps that have been waiting to update for a week.  I don't really care about the update, I would just like to use them, but the are stuck waiting.  I have tried powering down, syncing with my computer...all fails.  Any ideas?

    At this point you have no choice but to update the or delete them and reinstall them since you wont be able to use them until they update - or come out of the "waiting" loop.
    Make sure that you do not have a stalled download in iTunes - a song or podcast .... if you have a download in there that did not finish, complete that one first. Only one thing can download at a time on the iPad so that could be what is causing the problem.
    If that doesn't work - sign out of your account, restart the iPad and then sign in again.
    Settings>Store>Apple ID. Tap your ID and sign out. Restart the iPad by holding down on the sleep button until the red slider appears and then slide to shut off. To power up hold the sleep button until the Apple logo appears and let go of the button.
    Go back to Settings>Store>Sign in and then try to update again. Tap one waiting icon only if necessary to start the download stream.
    You can also try deleting the waiting icons - tap and hold down on an icon until it wiggles - the tap the X on the icon to delete it. Then try to download again.
    You can try resetting all settings. Settings>General>Reset>Reset All Settings. You will have to enter all of your app preferences and device settings again.

  • Apple send the iphone from Singapore, but i'm purchasing from malaysia apple online store, how about the warranty?

    I receive the parcel that apple sent today, but i found that Apple send the iphone from Singapore, but i'm purchasing from malaysia apple online store, How about the warranty? is that warranty available in malaysia?? or singapore ?

    Singapore is the AFE distribution centre for Apple , in the same way all online purchases from Apple in Europe ship from Ireland the European Distribution centre
    As Templeton has indicated the location you buy from is the only relevant information for warranty

  • I can't connect my canon mp160 to my new apple iMac desktop. It just won't print although it comes up as the printer. there is no driver for this from canon who states that I probably don't need a driver for this

    I can't connect my canon xp160 to my new IMAC. It does recognize it but won't print. there is no driver for this as per Canon and they state that I may not need one. thanks!1

    If you want to print, then you will need a printer driver. There is no printer driver available from Apple for the MP160. And the last driver that Canon released for this model was for OS X 10.7. You may be able to install this 10.7 driver, although it is not digitally signed so Gatekeeper will block the installation. To get past Gatekeeper, you can hold down the Control key and click on the installer. A pop-up menu will appear. Select Open. You will then be given the option to install the old driver.
    With the driver installed, add the printer via Printers & Scanners and see if you can print.

  • Issue when installing SQL Server Express 2012 - "The requested control is not valid for this service" + "Could not find the database engine startup handle"

    Good morning,
    I'm experiencing the following issue when installing Microsoft SQL Server Express 2012 (with tools, SQLEXPRWT_x86_ENU.exe) on the laptop of my company;
    Installation goes plain until around the end of the progress bar, it stops on the setup of
    SqlEngineDBStartConfigAction_install_configrc_Cpu32
    giving 7-8 times, even pressing "Cancel", the message "The requested control is not valid for this service";
    After this, I receive one last message ""Could not find the database engine startup handle", then installation ends with failures, in particular the Database Engine and the Server Replication failed to be installed.
    I've put in my SkyDrive the error log I received after the install;
    I'm at full disposal if you need further information,
    thank you in advance
    Best regards
    Francesco

    Well, i just ran into this issue and the problem was lack of admin rights. It was my company's laptop so got the setup initiated by my company's IT team with admin rights. However, the upon completion of setup, i go the same error messages as stated above: 
    SqlEngineDBStartConfigAction_install_configrc_Cpu32
    giving 7-8 times, even pressing "Cancel", the message "The requested control is not valid for this service";
    After this, I receive one last message ""Could not find the database engine startup handle", then installation ends with failures, in particular the Database Engine and the Server Replication failed to be installed.
    Also, if you open SQL Server Configuration, the status of the service is "Change Pending" and you would not be able to set the startup login type to Local Service/System/Network.
    Then, I just got my account added as Local Admin and then tried to start the service and was able to.
    However, I am not sure whether same was the case for you.
    Please mark the answer as helpful if i have answered your query. Thanks and Regards, Kartar Rana

  • How does the copy button work in safari for ipad (copy button under facebbok share button)?

    How does the copy button work in safari for ipad (copy button under facebbok share button)?

    On a website ...  
    Tap the Action icon bottom of that window. (white square with a right facing arrow) then tap Facebook.
    You should see the following depending on the what content the website can share.
    Copy / Mail / Message / Twitter / Print  / Bookmark

Maybe you are looking for

  • New iPod touch 5th generation charger won't work with computers or USB power adapter?

    I just got this charger less than two weeks ago and just yesterday it started saying "This cable or accessory is not certified and may not work on this iPod." It will only work on some occasions, but most of the time it won't. Other times it will sho

  • I double click on the Mozilla Firefox desktop item and it wont open!

    I tried to open firefox and it wont. I'll double clicked on the icon and nothing will open. Windows explorer opens fine but not firefox. I even Uninstalled it then re-installed it but still nothing. it was working fine earlyer today though. can you h

  • Report to Evaluate the Total Cost of Producing a Meterial

    Dear Experts, Is there any report from where I can generate the total cost incurred for producing a material for a given period of time. Please Help Thanks

  • Why RFC adapter?

    hi, Can somebody brief me about why and where an RFC sender adapter can be used. It would be of great help if you can give some scenario where RFC sender adapter be used. Thanks, siva Maranani.

  • FCPX Makes Audio Sound "Tinny"

    I have an absolutely bizarre problem: FCPX seems to be applying a "tin" sound to my audio file. Please find two audio samples at these links. The FCPX version is the clip in my event browser, with no effects or Audio Enhancements applied. The second