Problem with a regular expresion,for Scanner delimiter

Hi,I'm having a problem I have a the following example text
This is a simple #test with #lots of #sharps and normal text just for #testing #a #regular expression.
also I have this regular expresion \\w*#\\w*
the problem is that this regular expression as a delimiter in a Scanner class will read/parse only the words that dont have a +#+ as first char, the problem is that i need the exact opposite , i need to parse/read only the words that have a +#+ as first char.
Thanks in advance.

What you're trying to do is the opposite of what a Scanner is usually used for, but that's okay, because Scanner provides methods for that, too: Scanner sc = new Scanner(yourFile);
String token = null;
while ((token = sc.findWithinHorizon("#\\w+", 0) != null)
  System.out.println(token);
} Passing zero as the second parameter means no horizon, i.e., find the next match no matter how far along it is. If you want to limit the search to the current line, you can use findInLine().

Similar Messages

  • Last update for OS 10.8.2 caused big problems with HP photosmart B110 printer /scanner cannot scan does anyone have the same problem or a solution?

    Last update for OS 10.8.2 caused big problems with HP photosmart B110 printer /scanner cannot scan does anyone have the same problem or a solution?
    iMac is connected via wirelss to printer/scanner. All was working OK until update.

    Assuming that the HP software is up-to-date, but still not working, have you tried Image Capture in the Applications folder. Does that work?

  • Problem with "SELECT...FOR UPDATE OF..." and "POST command" combination

    Problem with "SELECT...FOR UPDATE OF..." and "POST command" combination
    Problem in committing transactions in Multiple Forms (Oracle Forms) with POST built-in command:
    Consider that the following statements are written in WHEN-WINDOW-CLOSED trigger of a called form.
    Statements in called form (Form name: FORM_CHILD):
    go_block('display_block') ;
    do_key('execute_query') ;
    -- Data from table_b will be populated in this block, based on the value of COLUMN_1 obtained
    -- from TABLE_A.
    -- Example: If the value of COLUMN_1 is 10, then all the matching records from TABLE_B, which
    -- are inserted with value 10 in TABLE_B.COLUMN_1 will be fetched and shown here.
    if user_choice = 'YES' then
    commit ;
    else
    rollback ;
    end if ;
    Statements in calling forms:
    There are two calling forms having following statements and it is going to call the above said called form.
    CALLING FORM 1
    Statements in KEY-COMMIT trigger:
    post;
    call_form(form_child, no_activate) ;
    Statements in ON-INSERT trigger:
    select column_1
    from table_a
    for update of column_1
    where column_2 = 'X' ;
    update table_a
    set column_1 = column_1 + 1
    where column_2 = 'X' ;
    insert into table_b ...;
    insert into table_b ...; Statements in KEY-COMMIT trigger:
    post;
    call_form(form_child, no_activate) ;
    CALLING FORM 2:
    Statements in ON-INSERT trigger:
    select column_1
    from table_a
    for update of column_1
    where column_2 = 'X' ;
    update table_a
    set column_1 = column_1 + 1
    where column_2 = 'X' ;
    insert into table_b ...;
    insert into table_b ...;
    insert into table_b ...;
    Our understanding:
    Assume that both the forms are running from two different machines/instances, issuing commit at the same time. In this case, forms will start executing the statements written in ON-INSERT trigger, the moment POST command is executed. Though the commit is issued at the same time, according to oracle, only one of the request will be taken for processing first. Assume that calling form 1 is getting processed first.
    So, it fetches the value available in COLUMN_1 of TABLE_A and locks the row from further select, update, etc. as SELECT...FOR UPDATE command is used (note that NOWAIT is not given, hence the lock will be released only when COMMIT or ROLLBACK happens) and proceed executing further INSERT statements. Because of the lock provided by the SELECT...FOR UPDATE command, the statements in calling form 2 will wait for the resource.
    After executing the INSERT statements, the FORM_CHILD is called. The rows inserted in to TABLE_A will be queried and shown. The database changes will be committed when user closes the window (as COMMIT is issued in its WHEN-WINDOW-CLOSED trigger). Then the SELECT...FOR UPDATE lock will be released and calling form 2's statements will be executed.
    Actual happenings or Mis-behavior:
    Calling form 2 starts executing INSERT statements instead of waiting for SELECT...FOR UPDATE lock. Also, the value selected from TABLE_A.COLUMN_1 is same in both the calling forms, which is wrong.
    The rows inserted into TABLE_B are having similar COLUMN_1 values in calling form 2 and they are fetched and shown in the called form FORM_CHILD.
    Note that in calling form 2 also POST only is issued, but the changes posted there are accessible in calling form 1 also, which is wrong.
    Kindly suggest us as to how to fix above problem. It will be much use, if you can send us the information regarding the behavior of Oracle Forms POST built-in also.
    Our mail ID: [email protected]
    Thanks a lot in advance.

    You have several problems:
    1. On-Insert will ONLY run if you have created a new record in a base-table block. If you haven't done that, then the POST command will not cause it to run.
    2. Select for update without a "no wait" will lock records for the first form, but when the second form tries this, it will hit the ORA-00054 exception, and will NOT wait. The only way you could make it wait is to issue an UPDATE sql command, which is not such a good way to go.
    All POST does is issues SQL insert or update commands for any changes the user has made to records in a form's base-table blocks, without following with a Commit command.
    Also understand that Commit is the same as Commit_Form, and Rollback is the same as Clear_Form. You should read up on these in the Forms help topics.

  • I having problem with the answer  question for the App Store. And I forgot the answer

    I having problem with the answer  question for the App Store. And I forgot the answer

    Pleae call 1800MYAPPLE ask to speak to account security

  • Why has my 3G stopped working on my iphone? It is enabled, and I never had problems with it before, but for about 2 months now it has refused to work and as a result I can't send any attachments such as photos or videos via text.

    Why has my 3G stopped working on my iphone? It is enabled, and I never had problems with it before, but for about 2 months now it has refused to work and as a result I can't send any attachments such as photos or videos via text.

    Cellular data is a feature from your phone carrier.  Have you contacted them to resolve your issue.

  • I am having major problems with the latest update for my itunes!

    I am having problems with the latest update for itunes, it says 'itunes has an invalid signature'. I have completely uninstalled itunes but now it wont download at all. Have tried downloading it 4 times tonight already. Anyone know how to get it to download? Or what to do?

    I am having problems with the latest update for itunes, it says 'itunes has an invalid signature'.
    That suggests that the installer is getting damaged during the download.
    I'd first try downloading an installer from the Apple website using a different web browser:
    http://www.apple.com/itunes/download/
    If you use Firefox instead of IE for the download (or vice versa), do you get a working installer?

  • RSAU461, problem with activating update rules for cube 0csrv_c01

    Hello,
    I have added new fields to data source 0CRM_SRV_PROCESS_H, then changed transfer rules, added characteristics to ODS 0crm_proh, and reactivated update rules 80crm_proh. But now I have problem with second update rules for this cube named 80crm_cnfh. It is not active and all fields in it have red status, error RSAU461, and I cannot activate it.
    What I should do? Should I change somehow that second source for data to my cube (change infosource, ods, rule?)
    Regards
    Radek

    hi
    As said by the Mti u have just changed the info objects in the ods and u need to map them with the specific info objects from the ods.
    double click on the Update rules of the cube and go to the characteristic tab there map the newly added info objects with the IO in the ods.
    Khaja

  • Problemas with file "ns_emails.xml" for SMTP EXCHANGE

    Hi,
    I have problems with my ns_emails configuration for a SMTP EXCHANGE Mail Server.
    I configured Outlook with this parameters and works: Autenthication: yes, SSL: yes, port: 25, host: gmail.smtp.com.
    In my BPEL process is a right msg, but the email doesn`t arrive:
    <2008-01-27 19:19:51,781> <INFO> <default.collaxa.cube.services> <Utils::initNotificationMode> Notification via voice, fax, SMS, IM or pager will be sent. Emails will be sent with the current settings. If you would like to enable them, please configure accounts in ns_iaswconfig.xml and then set the NotificationMode attribute in ns_emails.xml to either NONE, EMAIL or ALL.
    Please, ¿do you see something wrong with this file?
    <EmailAccounts xmlns="http://xmlns.oracle.com/ias/pcbpel/NotificationService"
    EmailMimeCharset=""
    NotificationMode="EMAIL">
    <EmailAccount>
    <Name>Default</Name>
    <GeneralSettings>
    <FromName>Laura</FromName>
    <FromAddress>[email protected]</FromAddress>
    </GeneralSettings>
    <OutgoingServerSettings>
    <SMTPHost>smtp.gmail.com</SMTPHost>
    <SMTPPort>25</SMTPPort>
    <AuthenticationRequired>true</AuthenticationRequired>
    <UseSSL>true</User>
    <UserName>[email protected]</UserName>
    <Password ns0:encrypted="false" xmlns:ns0="http://xmlns.oracle.com/ias/pcbpel/NotificationService">mypass</Password>
    </OutgoingServerSettings>
    </EmailAccount>
    </EmailAccounts>
    Thanks,
    Laura

    Hi,
    I know about domain.log file. In my first post, I put the message that I get.
    The problema is with the SMTP Exchange MS Server.
    I tried with a Local Mail Server with this parametes and its right.
    <GeneralSettings>
    <FromName>Laura Garcia</FromName>
    <FromAddress>testuser@lgrico-port</FromAddress>
    </GeneralSettings>
    <OutgoingServerSettings>
    <SMTPHost>lgrico-port</SMTPHost>
    <SMTPPort>25</SMTPPort>
    <UserName>testuser@lgrico-port</UserName>
    <Password>laura</Password>
    </OutgoingServerSettings>
    But with this configuration its wrong:
    <OutgoingServerSettings>
    <SMTPHost>smtp.gmail.com</SMTPHost>
    <SMTPPort>25</SMTPPort>
    <AuthenticationRequired>true</AuthenticationRequired>
    <UseSSL>true</UseSSL>
    <UserName>[email protected]</UserName>
    <Password ns0:encrypted="false" xmlns:ns0="http://xmlns.oracle.com/ias/pcbpel/NotificationService">pass</Password>
    </OutgoingServerSettings>
    My company has the same kind of mail server than gmail, so I,m trying to configure this first.
    This is domain.log and it`s right, I can´t see where is the problem.
    <2008-01-29 09:26:05,006> <INFO> <default.collaxa.cube.services> <Utils::initNotificationMode> Notification via voice, fax, SMS, IM or pager will be sent. Emails will be sent with the current settings. If you would like to enable them, please configure accounts in ns_iaswconfig.xml and then set the NotificationMode attribute in ns_emails.xml to either NONE, EMAIL or ALL.
    <2008-01-29 09:26:05,053> <DEBUG> <default.collaxa.cube.services> <oracle.bpel.services.notification.queue.QueueConnectionPool::QueueConnectionPool> Creating connection pool for java:comp/env/jms/Queue/NotificationSenderQueueConnectionFactory initial size 20
    <2008-01-29 09:26:05,053> <DEBUG> <default.collaxa.cube.services> <oracle.bpel.services.notification.queue.QueueConnectionPool::QueueConnectionPool> Fetched a queue connection from pool java:comp/env/jms/Queue/NotificationSenderQueueConnectionFactory, available connections=19
    <2008-01-29 09:26:05,053> <DEBUG> <default.collaxa.cube.services> <oracle.bpel.services.notification.queue.sender.Publisher::init> Start of send(type,caller,message) type = email caller = BPEL
    <2008-01-29 09:26:05,053> <DEBUG> <default.collaxa.cube.services> <oracle.bpel.services.notification.queue.sender.Publisher::init> Notification ID 50d528357d42a957:-4d67d6df:117c49fc103:-7fcf
    <2008-01-29 09:26:05,053> <DEBUG> <default.collaxa.cube.services> <oracle.bpel.services.notification.queue.sender.Publisher::init> Start Persisting notification in database
    <2008-01-29 09:26:05,100> <DEBUG> <default.collaxa.cube.services> <oracle.bpel.services.notification.queue.sender.Publisher::init> End Persisting notification in database
    <2008-01-29 09:26:05,100> <DEBUG> <default.collaxa.cube.services> <oracle.bpel.services.notification.queue.sender.Publisher::init> Start of send(type,caller,message)
    <2008-01-29 09:26:05,100> <DEBUG> <default.collaxa.cube.services> <oracle.bpel.services.notification.queue.QueueConnectionPool::QueueConnectionPool> Released queue connection to pool java:comp/env/jms/Queue/NotificationSenderQueueConnectionFactory, available connections=20
    Thanks for your answers,
    Laura

  • Hi I have a problem with my licence number for Lightroom

    Hi I have a problem with my licence number for Lightroom, has been forced to re-install lightroom again but, have downloaded a trial version of adobe but now works license number are not, there are some who can help me with what is going wrong. Thanks Henrik

    Download Lightroom 5 from Product updates and install, use your serial number

  • Problems with java regular expressions

    Hi everybody,
    Could someone please help me sort out an issue with Java regular expressions? I have been using regular expressions in Python for years and I cannot figure out how to do what I am trying to do in Java.
    For example, I have this code in java:
    import java.util.regex.*;
    String text = "abc";
              Pattern p = Pattern.compile("(a)b(c)");
              Matcher m = p.matcher(text);
    if (m.matches())
                   int count = m.groupCount();
                   System.out.println("Groups found " + String.valueOf(count) );
                   for (int i = 0; i < count; i++)
                        System.out.println("group " + String.valueOf(i) + " " + m.group(i));
    My expectation is that group 0 would capture "abc", group 1 - "a" and group 2 - "c". Yet, I I get this:
    Groups found 2
    group 0 abc
    group 1 a
    I have tried other patterns and input text but the issue remains the same: no matter what, I cannot capture any paranthesized expression found in the pattern except for the first one. I tried the same example with Jakarta Regexp 1.5 and that works without any problems, I get what I expect.
    I am using Java 1.5.0 on Mac OS X 10.4.
    Thank to all who can help.

    paulcw wrote:
    If the group count is X, then there are X plus one groups to go through: 0 for the whole match, then 1 through X for the individual groups.It does seem confusing that the designers chose to exclude the zero-group from group count, but the documentation is clear.
    Matcher.groupCount():
    Group zero denotes the entire pattern by convention. It is not included in this count.

  • New problems with Acrobat 11.03 for Mac

    I'm having new problems with my Adobe Acrobat 11.03 for Mac.  These issues are relatively new and did not occur when I first bought the product about 9 months ago.
    1) When scanning documents from an HP scanner into Adobe on my Mac, the scanning works fine, but a multi-page document (scanned as one) is saved as a separate PDF for each page.  Bothersome to then have to combine all those separate files into one doc.  I can do it, just don't think I should have to take the time.
    2) Occasionally, when working in Adobe, the menu bar at the top will disappear when I click on the Adobe icon or a previously saved PDF.  Very frustrating.  Can't make a note or save the document without knowing the shortcuts, as the menu has disappeared.  Once I click somewhere outside Adobe, the menu bar reappears for the other programs.  This happens over and over. 
    Any ideas?
    Thanks.

    Hey JeffSPHR,
    Please refer this KB doc link mentioned below and try troubleshooting scanner issues:
    Troubleshoot scanning problems | Mac OS
    Let me know if this helps.
    Regards,
    Anubha

  • Problems with the new Pages for Mac

    I'm starting to see countless problems running the new Pages for Mac (5.0.1) and I can't find a way to resolve them.
    1. when I'm typing and want to delete word(s), I'll use the alt+delete function for ease, however this starts deleting words after the cursor, merging words together and changing my sentece. It comes from when I'm deleting as the new pages is giving me the dropdown menu for the autocorrect word.
    2. grammar check is off. Namely, it picks a random point in a word and moves on from there. EX: "because of the" will have "use of the" underlined in green and give me recommendations to change to "because of the" or "cause of the". Using those recommendations, I'll end up with something like: "becabecause of the"
    3. the find and replace function jumps around in the paper, and sometimes doesn't even display the word currently selected (leaving the user to scroll around looking for what is selected)
    4. Autocorrect has vanished for some reason: no autocapitalization, no turning fractions such as 1/2 into a tidy and neat fraction with small numbers for numerators/denominators, etc.
    I'm still using it, and these are what I have found, so there may be more later as I continue to use it. If anyone has found ways around these bugs, please let me know.
    Thanks!

    Semnani wrote:
    4. Autocorrect has vanished for some reason: no autocapitalization, no turning fractions such as 1/2 into a tidy and neat fraction with small numbers for numerators/denominators, etc.
    Pages 5 now uses the system autocorrect, which does not have as many features as the one inside Pages 4.  Some things you can add manually there.   Others you have to ask Apple to add via
    http://www.apple.com/feedback
    Or continue to use Pages 4 instead.

  • Problems with Time Machine backup for two machines to one external drive

    I have a brand new WD 500GB USB My Book external drive plugged into my Intel Mac Mini running 10.5.1 to use as a TM backup drive (TM reformatted it to HFS+ journaled). The Mini's connected by ethernet to the Airport Extreme. It works great. I setup my wife's MacBook Pro 17" Dual Core 2 w. 10.5.1 for TM using the Mac Mini's TM backup drive and it works fine (a little slower at 811.n wi-fi speeds, but OK). I have the Mac Mini setup in Energy Saver to shut down at night and restart in the morning. The morning after I setup my wife's MacBook Pro for TM I found a big black & white message (in half a dozen languages) on the Mac Mini saying start up failed and I need to reboot using the power button. I did and everything was cool. Now comes the problem, it's done it three days in a row so it looks like there is a problem with the TM setup. It didn't do this before I setup my wife's computer for TM.
    Any thoughts on what is causing this? We've had minimal problems with Leopard setup (short of a brief hunt for an Airport Extreme Drive and a couple of network printers during initial setup).

    1 mistake @ a time wrote:
    I works fine over a network if the TM drive is attached to another Mac running Leopard. It won't work with an Airport drive (Apple deep sixed that feature in the final release).
    We have an Airport Extreme base station, and we plan to add an Airport Express to boost the power to reach the second floor. We are ordering 4 iMacs, 20", plus I have the Macbook 13" that I have had for a few months.
    We thought we could connect one large external drive via firewire cable to one of the iMacs and use it to back up all five computers via Time Machine.
    Is that possible, or does everybody need their own external drive?
    Thanks!
    susan

  • Problem with getting specified pages for printing

    requested Sir,
    I am sanjeev, presently working with adobe indesign for publishing.
    i am working verious sets of master pages,
    now have a problem go gate specific pages for print in the same software.
    it shows saction name that i could not inditify
    give me the message
    (one or more of th pages specified are not valid page name)
    so how gate the valid name of pages?
    please slove my problem,
    thanks
    sanjeev

    If your document has more than one section (sections are used to restart page numbering and similar tasks) you can identify the pages using either the logical name, which uses the section prefix and the "logical' page number which is the number that appears in the page marker, or you can use the absolute page number, which is the position in the document. You can set your preferences to display section or absolute page numbering in the Pages panel, too.
    Unless you assigne some other prefix, sections are labeled as Section I, Section II and so on, and pages are designated by Section:Page# in the dialogs. If you want to use absolute page numbering in the dialog instead, you can add a + sign in front of the page number in the dialog: +6-+12 will be the sixth though twelf pages in your document, even if they are in different sections and carry the numbers vi - 4, for example.

  • I am getting an error encountered problem with the display driver for my Photoshop CS5 extended

    I have Windows 7 and have used CS5 extended with no problems for quite a while now.
    Last week I started up CS5 and received the error:
    "Photoshop has encountered a problem with the display driver and has temporarily disabled GPU enhancements. Check the video card manufacturers website for the latest software. GPU enhancements can be enabled in the Performance panel of Preferences."
    "Please close program and uninstall and re-install if problem persists"
    I was able to edit, however when I went to save my work it would not do so. The following error came up.
    "Could not complete the command because the extension could not be loaded"
    "Could not save a copy as .....because of a program error"
    I checked to make sure I have the latest driver, I also uninstalled and re-installed the program and I am still getting the errors.
    Can anyone help with this?

    Error 1402 | Error 1406 | Acrobat, Reader

Maybe you are looking for

  • Will apple replace fake magsafe charger

    hi i have bought a macbook from a dealer it is still in warranty the problem is that the charger is a fake and is now not working i recived the charger with the macbook pro will apple replace it if they will what shall i say to them

  • Storage Space - Parity spaces is the same as New Spanned Volume?

    Hi, i am very new to Windows Server 2012, i am trying to setup my Windows server 2012 may i ask how do i format my Hardisk to parity space? is parity space the same as New Spanned Volume? currently my server has 4x 3TB hardisk, if one of my hardisk i

  • Hard drive crash retrieving purchased music

    I just recently bought a new computer because my hard drive crashed on the old one how do I retrieve my purchased music from iTunes to reinstall on my new computer

  • Can you set SOAP receiver as sender?

    i am running PI7.11 SP0.4. Can i set a SOAP Receiver as a sender to give the impression of a Synchronous interface? as sometimes there may be a response?   or am i asking the impossible?

  • I'm getting a runtime error what should I do

    I'm trying to update itunes but getting a runtime error message as follows Any ideas on what to do next?