Get matched delimiter when using regex in Scanner

Hi!
I was wondiering if it is possible to get the value that the delimiter actually matched when using regular expressions in the Scanner?
I have for example the following code:
Scanner sc1 = new Scanner("test 123 string 456");
sc1.useDelimiter("\\d+");
while (sc1.hasNext()) {
     System.out.println(sc1.next());
}will output:
test
stringBut I would also like to know what digits that the delimiter matched.
Best regards
Lars

Scanner.matchResult() returns a MatchResult, which has start() and end() methods. After your very first call to next() this is not helpful, but after your second call to next() you can use the previous value returned by end() and the new value returned by start() and take the substring between those positions.
...does that make sense? It's not a panacea, but it's better than nothing.

Similar Messages

  • How can we get ADFSecurity work when used in OC4J, OID and OAM?

    I am getting error in http server log "mod_oc4j: Response status=499 and reason=Oracle SSO, but failed to get mod_osso global context."
    But I am not using Oracle SSO and my client doesn't want to use it either, I am using OAM SSO(CoreIDSSO) in my configuration. Please read the details below.
    I am using ADFSecurity in an app that is protected by OAM. To migrate ADFSecurity permissions from
    system-jazn-data.xml to OID, I used JAZNMigrationTool to populate OID with Grantees and Permissions. OAM gives login page, and authentication works fine.
    But ADFSecurity is not working. ADFComponent Delete button is enabled even for roles that dont have permissions for the iterator delete.
    - The app works fine when I use without OAM. ADF Security permissions work fine.
    - The app works fine when used with OAM, but with ADFSecurity disabled (enforce=false).
    - When I enforce ADFSecurity alongwith OAM, ADFSecurity is not working.
    In the doc "Oracle Containers for J2EE Security Guide b28957", there is a mention of use of CoreIDPrincipal for permissions. Our OID Permissions entries show
    LDAPRealmRole for attribute orcljaznprincipal. I am not sure if this could be the reason.
    We have configured AccessServerSDK for the SOA instance and have policy for the urls in the policy manager. We have entries in orion-application.xml, orion-web.xml and system-jazn-data.xml as per the documentations.
    How can we get ADFSecurity work when used with OID and OAM?

    Have you been able to successfully integrate OAS with OAM & OID? We have similar requriement and so far we have not been able to get it working.
    We have application specific roles which we map to OID roles using orion-application.xml.
    Any pointers to achieve this would be greatly appreciated.
    thanks,
    Dipal

  • Getting an error when using adobe photoshop CC, "Could not move the data because of a program error". Any idea on what this means?

    Getting an error when using adobe photoshop CC, "Could not move the data because of a program error". Any idea on what this means?

    Have no idea of what you were even doing in Photoshop my crystal ball is out for repairs so I can not see.  

  • Getting Compilation error when used SET or MULTISET operator on nested tabl

    Dear All,
    I am getting Compilation error when used SET or MULTISET operator on nested tables inside a procedure.
    This is working fine in other DB installations of 10g but does not work in another 10g DB.
    it says "wrong number of parameter or datatype used in SET"
    Can any one suggest what went wrong here?
    Thanks in advance.

    Can any one suggest what went wrong here?Only if you would post the query and Oracle versions on both databases.
    Besides, this forum deals with issues in Oracle product installation. So post this query in SQL PL/SQL forum for better response.

  • My Application gets Error 37 when using Serial Port VIs.

    My Application works fine developed with LV 6.1. Then I updated to LV 7.1 and now the Executable of my application gets error 37 when using the old serial port functions. The "serpdrv" file is located in the application directory and is from 02/2002. The application runs well in the development environment after I placed the "serpdrv" file in the LabView directory. I tried to put a line with "serialDevices=..." in the .ini-file of my application but this did not cause an improvement. I also tried to rebuild the EXE with this line in the "labview.ini" file but nothing changes.
    Does anybody have another idea ?
    Many thanks for help
    Thomas

    >Did you actually replace the old serial functions that come with 7.1 with the functions from 6.1?
    Yes. E.g. "open serial driver.vi" uses "open device" with "serpdrv" as device string.
    I had the same problem running my application as VI´s. After the copy of serpdrv into the LV 7.1 directory everything works fine.
    I don´t understand why the application running as a .exe doesn´t find the serpdrv when it is in the same directory....
    Nevertheless many thanks for your answer
    Thomas

  • Does 2012 mac mini get very hot when using logic pro

    does 2012 mac mini get very hot when using logic pro

    Are you saying that your machine does or is it an enquiry before buying ? I use a 2011 server model - well, it does get hot over a period of time, but I've very rarely heard the fan kick in, its a surprise when it does. As far as I know the casing has been specifically designed to conduct heat, rather than having any fancy grilles and so on, being so small in size. I haven't found it to be cause for concern, if that's any help.
    Slidersson is in need of more cold showers.

  • Can't get my mail when use the USB Ethernet adapter

    I can't get my mail when use the Apple USB Ethernet Adapter. If I use a wireless connection, there is no problem. The LAN which I'm trying to connect is behind a proxy server but the Internet is working 100%.

    Hi ViK,
    This sounds like a question for the network administrator of the location. Without knowing how the proxy is set it's impossible to know what it's blocking (incoming/outgoing). It sounds like it might be filtering the incoming mail server.

  • Why do I get bright colors when using the smudge tool?

    Why do I get bright colors when using the smudge tool?

    Thank you!!!
    *Caryl  *
                               (my flickr page ↓)
    *https://www.flickr.com/photos/feathersarenice/
    <https://www.flickr.com/photos/feathersarenice/>*
    We were all born mad. Some remain so.
    "Reality is whatever refuses to go away after I stop believing in it."
    Philip K. Dick

  • Iphone 4s getting hot up when using the network. is it a sim problem

    iphone 4s getting hot up when using the network. is it a sim problem or battery problem?

    You posted in the iPad forum instead of the iPhone forum. To get answers to your question, next time post in the proper forum. See https://discussions.apple.com/index.jspa  I'll request that Apple relocate your post.
     Cheers, Tom

  • Device gets turned off when using data on mobile

    device gets turned off when using data on mobile... and not responding,i.e., if we hold the power button also there was no response,not getting on... when I connect it to charger,after 10min it gets automatically turning on.otherwise no chance to use the device..sometimes it gets off at 25%, sometimes at even 72% battery...seems it might be a severe problem..please suggest a solution..

    This might help:
    http://helpblog.blackberry.com/2013/02/restart-blackberry-z10/

  • Getting a ReportDocument when using a RemoteReportProxy

    Business Problem
    I have several reports that are run locally for some users and served up from an unmanaged report server for others.  We recently upgraded Visual Studio to VS2008 from VS2003.
    Under VS2003, we were able to populate a set of "standard" parameters on our CrystalViewer.  These parameters would be sent to all reports whether they were defined or not.  If the report being called did not define one of these parameters, it would ignore them and render the report using the parameters that matched parameters that were defined on the report.
    Under VS2008, we get an error telling us we have an invalid parameter when we attempt to load the report.
    Users that fit the criteria for running locally (proper client software installed, good connection, etc) download the latest report from th unmanaged server.  I can get a handle on the ReportDocument and remove any "standard" parameters that do not have matching parameter definitions on the report that is about to be loaded.  Problem solved for these users!
    Users that run the reports on the server (web services automatically created for the reports through Visual Studio using the built in Custom Tool for CR.net2008) reference the appropriate web service on the server through a RemoteReportProxy object that is set as the ReportSource on the CrystalViewer.  I have not been able to find a way to reference the underlying ReportDocument to verify the parameters match properly before loading it in the CrystalViewer.  This is the problem that I need help solving!

    When using the serverfilereport web service, your access to the reportu2019s properties are limited to the Vieweru2019s api.
    So what needs to be done is to bind the report web service to the viewer first, and then grab the parameterfields collection from the Crystareportviewer.Parameterfields property:
    CrystaReportviewer1.Reportsource = myReport
    myParameterfields = Crystalreportviewer1.ParameterFieldInfo
    From there, you should be able to access the parameters and iterate through them to determine which ones match the set of u201CStandardu201D parameters and only set the necessary ones.  After doing that, set your populated collection of parameterfields back to the viewer:
    CrystalreportViewer1.ParameterFieldInfo = myParameterFields
    Ludek

  • HT1665 Why don't I get FM radio when using lightning adaptor with my ipod?

    I've got a 7th generation Nano.  Using the Apple Lightning adapter for my dock, I get no radio reception.  What's going on?

    You need to have your headphones inserted - they're the aerial.
    I've tried a variety of headphones and they all seem to give reception. Not sure how you're affected when using your dock ie whether you can still have earphones inserted. You may need to get a double male cable and insert one end in the ipod and one in your dock (if it has that facility).
    M.

  • Does anybodys iphone 4s get very hot when using devices such as camera?

    The side of my new iphone 4s get so hot on the top corner you cant keep you finger on it when using my camera. I know there is a problem with the battery but mine drops so fast it rarely lasts the day. Is their anything i can do now?

    neilfromgrays wrote:
    The side of my new iphone 4s get so hot on the top corner you cant keep you finger on it when using my camera. I know there is a problem with the battery but mine drops so fast it rarely lasts the day. Is their anything i can do now?
    It would not be uncommon for the 4S to get a LITTLE WARM while getting used with the screen on etc, but not to the point where it gets so hot that you cannot keep your finger on it.
    If you can easily replicate the problem and you got it from an Apple Store then I would make an appointment to have it looked at/replaced.
    If you got the 4S from elsewhere then I would get in contact with them and arrange for it to be looked at/replaced.

  • Can we get row counts when using dbms_datapump?

    When using dbms_datapump, is there a way to get the rows loaded for each table, similar to the log files when using the command line? I can't seem to find anything. I'm trying to import. Database is 10g r2.

    if you don't have to use DBMS_DATAPUMP and can use external tables for the import (both work exactly same way), then you can use ROWCOUNT
    INSERT INTO MYTABLE SELECT * FROM EXTERNALTABLE;
    v_number_of_rows := SQL%ROWCOUNT ;
    COMMIT;
    if you have to use DBMS_DATAPUMP then look at "worker status types" in this document
    http://www.stanford.edu/dept/itss/docs/oracle/10gR2/appdev.102/b14258/d_datpmp.htm#i997417

  • Getting an error when using fm 'excel_ole_standard_dat'

    Hi All,
    I am getting an error when trying to generate an excel file with the data in the internal table using fm 'Excel_ole_standard_dat'.
    can anybody help me in this.
    Thankyou,
    Prasanna

    Hi Prasanna
    Could you tell me what's the sy-subrc code you are getting ?
    Pushpraj

Maybe you are looking for

  • Open and Close GL Posting Periods

    Hi, We would like to allow only certain users to post to a previous month - is there a way that we can do this?  For example, we opened Feb. but due to month end the accountants still need to make postings to Jan. - can we give only them access to Ja

  • Can I use this solution if using Mac OSX 10.9.5?

    Illustrator CS4 crashes whenever I attempt to print.  It crashes before the print box even appears. I found a possible solution here from Adobe Crash printing | Illustrator, InDesign | CS3, CS4 | Mac OS 10.7 but it refers to 10.7 and I'm using a Mac

  • How can I activate a song that downloaded but won't play?

    I downloaded a 2 songs by the same artist. I listened to the first then attempted to listen to the second, but the first song kept playing. The second song shows that it downloaded, but isn't available to listen to. Thanks for your help.

  • RAC 10g on VMWARE :GSD and ONS services not getting up.

    Hi, I have successfully configured RAC (LINUX) on VMWARE and also stopped successfully on VMWARE server. When next day rebooted the server and starting the crs services it is not starting when i check the services fine below output. How I can start t

  • How To Configure Videos To Expand Stereo On a 6 Channel Audio System?

    I Have A 6 Channel Audio System , I know You tube Supports Stereo Only,  but that's not my problem, my problem is that i had just reinstalled my  OS, and now only my Front Speakers works while Playing Videos on You  tube or any other Internet Stream.