ERROR! What does this error mean?

Exception in thread "main" java.util.regex.PatternSyntaxException: Illegal repetition
{adj}
at java.util.regex.Pattern.error(Pattern.java:1713)
at java.util.regex.Pattern.closure(Pattern.java:2775)
at java.util.regex.Pattern.sequence(Pattern.java:1889)
at java.util.regex.Pattern.expr(Pattern.java:1752)
at java.util.regex.Pattern.compile(Pattern.java:1460)
at java.util.regex.Pattern.<init>(Pattern.java:1133)
at java.util.regex.Pattern.compile(Pattern.java:823)
at java.lang.String.replaceFirst(String.java:2147)
at MadLibs.MasterListandStories(MadLibs.java:31)
at MadLibsMain.main(MadLibsMain.java:6)
I dont get a compile error, but if i try to replace a word in a sentence w/ something the user types in i get the above error

String.replaceFirst takes a regexp as first argument. {adj} is an invalid regexp because { and } mean something in a regular expression, and you usage of these in this context is wrong. You need to escape those characters to make it work, like this:
s[0].replaceFirst("\\{adj\\}", Jin.readLine("Enter an adjective: "));
s[0].replaceFirst("\\{verb\\}", Jin.readLine("Enter a verb: "));
s[0].replaceFirst("\\{verb\\}", Jin.readLine("Enter a verb: "));
s[1].replaceFirst("\\{noun\\}", Jin.readLine("Enter a noun: "));This will do what you want.

Similar Messages

  • What does this error mean? There was an error in the App Store. Please try again later. (100)

    what does this error mean? There was an error in the App Store. Please try again later. (100)

    I have the same problem and thought it might be related to moving to Denmark. My app store account was set up for USA and then the error number in parentasis was (13). After changing the profile to Denmark the number changed to (100), like yours

  • While importing a CD into my iTunes library I kept getting the following error message- iTunes library cannot be saved- An unknown error occurred (-54).  What does this error mean and what can I do about it??

    While importing a CD into my iTunes library I kept getting the following error message- iTunes cannot be saved- An unknown error occurred (-54).  what does this error mean and what can I do about it??

    The CD I imported (in the above post) is now not in my iTunes library. Any help would be appreciated .

  • Cannot upload music says I O error what does this mean?

    When uploading tracks says high res best wav or aiff when track is chosen to upload says I O error what does this mean?Tried all types of files same thing!!
    == URL of affected sites ==
    http://www.jinglepunks.com

    connect it to your computer and open iTunes

  • What does this error message mean and how do I solve it? "Sorry, one or more of the following command-line tools was not found:  /usr/bin/lsbom, /bin/pax, /bin/mkdir, /bin/chmod, or /usr/bin/update_prebinding."

    When I try to open up this program, Pacifist, I receive this error message. Here's a screenshot. http://i.imgur.com/v717w.jpg What does this error message mean and how do I solve it?

    It sounds like some of the Unix Executable commands were removed (or the permissions to those were modified) out of the /usr/bin/ folder.  You can try opening disk utility and repairing permissions on Macintosh HD or you can reboot your computer and holding down option-r when it comes back up to reinstall Lion again.  This will not delete your personal information or applications you have installed but it would be best to back it up to Time Machine before you do.  The article on how to do this is here. (http://www.apple.com/macosx/recovery/)  I have had to do this before and it works like a charm.  It should fix your issue but grab a cup of coffee because its going to take about 35 - 40 minutes depending on how fast your computer is.

  • What does this error message mean? disc recording not found

    What does this error message mean? disc recording not found

    Often it suggests issues with device filters in your registry. But it's probably best to check the situation more closely.
    Could you post your diagnostics for us please?
    In iTunes, go "Help > Run Diagnostics". Uncheck the boxes other than DVD/CD tests, as per the following screenshot:
    ... and click "Next".
    When you get through to the final screen:
    ... click the "Copy to Clipboard" button and paste the diagnostics into a reply here.

  • I have just tried to sync my iphone. Error message saying it cannot be synced has popped up quoting error code (-50). I have just removed old iphone backups from itunes but was very careful to not delete the current one. What does this code mean?

    Hi there,
    I have just tried to sync my iphone.
    Worryingly an error message saying it cannot be synced has popped up quoting error code (-50)
    I have just removed old iphone backups from itunes but was very careful to not delete the current one
    What does this code mean?

    http://support.apple.com/kb/TS1583

  • What does this error message when I try to do updates mean? And how can I fix it? Thanks.   The operation couldn't be completed. (NSURLErrorDomain error -1012.)

    What does this error message when I try to do updates mean? And how can I fix it? Thanks.   (The operation couldn’t be completed. (NSURLErrorDomain error -1012.)
    James
    maverick 10.9.1

    Please read this whole message before doing anything.
    This procedure is a diagnostic test. It’s unlikely to solve your problem. Don’t be disappointed when you find that nothing has changed after you complete it.
    The purpose of the test is to determine whether the problem is caused by third-party software that loads automatically at startup or login, by a peripheral device, by a font conflict, or by corruption of the file system or of certain system caches.
    Disconnect all wired peripherals except those needed for the test, and remove all aftermarket expansion cards, if applicable. Start up in safe mode and log in to the account with the problem. You must hold down the shift key twice: once when you boot, and again when you log in.
    Note: If FileVault is enabled, or if a firmware password is set, or if the boot volume is a Fusion Drive or a software RAID, you can’t do this. Ask for further instructions.
    Safe mode is much slower to boot and run than normal, with limited graphics performance, and some things won’t work at all, including sound output and Wi-Fi on certain models. The next normal boot may also be somewhat slow.
    The login screen appears even if you usually login automatically. You must know your login password in order to log in. If you’ve forgotten the password, you will need to reset it before you begin.
    Test while in safe mode. Same problem?
    After testing, reboot as usual (not in safe mode) and verify that you still have the problem. Post the results of the test.

  • What does this error means? "Line 20 column 57: character content of element "language" invalid; must be a string with length equal to 3 (actual length was 7) at XPath /package/book/metadata/languages/language" "

    Hi there.
    I am about to publish a book in English and Chinese.
    What does this error means?
    Line 20 column 57: character content of element "language" invalid; must be a string with length equal to 3 (actual length was 7) at XPath /package/book/metadata/languages/language"
    And where is line 20, column 57?
    Thanks folks!

    Go into iTunes Producer and select from the dropdown, don't type.
    cs
    iBooks Author Guide

  • TS1846 What does this error message mean?

    What does this error message mean? I am trying to burn a project to DVD...
    Formatting was not successful.  Layer 0 exceeds the maximum layer size allowed.  Please choose a suitable marker location that will support this condition.

    The project is 1:22:30  - 1080P HD (4.9GB)...I am using the share drop down and hitting DVD...I am using a DVD+R Dual Layer 8.5GB...It processes for about an hour and a half the status bar gets almost done and then the error message comes up...thanks for any help you can give me

  • TS1702 0xE8000004-what does this error message mean?

    0xE8000004-what does this error message mean?  I get it when trying to sync my Garmin USA app.

    See http://support.apple.com/kb/TS3221.

  • What does this error means "Could not create Entity EJB"

    This error occurs when i tried to run my entitybean example, so may i know what does this error means? How can i resolve it?
    I am connecting to an Oracle8 DB, but it seems tat i have problem connecting to it and retrieving record from the database. Can anyone help me how to establish a connection to my Oracle DB??
    Need help urgently. thanx.!

    have you tried simple jdbc connection?
    Driver drv = Class.forName("oracle.jdbc.driver.OracleDriver");
    Connection conn = DriverManager.getConnection(oracle:jdbc:thin:@myhost:1521:instance, "usrname", "password");
    If this works you're able to connect! so check that your oracel datasource is well specified in your deploiement descriptor and that your bean references this datasource.
    hope it helps

  • E61 - Latest Firmware - What does this error mean ...

    What does this error mean?
    Profiles in same realm must have same user name
    I am trying to setup a PBXes.com account and since I upgraded firmware I get this message now, when trying to save a profile.
    There were no other profiles in the same prior, is this somethign stuck from an old configuration.
    Rae

    Actually I just fixed it by deleting the profile and entering it as new. I saved it after each step of the profile creation process and was able to reproduce the problem when I entered a password on the proxy settings but not yet on the registry settings. Once I entered the same user name and password on both proxy and registry, I was able to save the profile again. So I guess I must have mistyped the password in one of the settings before.

  • Error -54 when synching iPad with iTunes.... what does this error mean?

    error -54 when synching iPad with iTunes on laptop.... what does this error mean?

    Hey MacFromManila,
    It's a different method of backing up your iPhone 4s.  This article covers the differences between the two and may actually be able to help you choose between them:
    Choosing an iOS backup method (Should I use iTunes or iCloud to back up my iOS device?)
    http://support.apple.com/kb/HT5262
    Cheers,
    - Ari

  • What does this error message mean?  MFMessageErrorDomain error 1028.

    What does this error message mean? 
    MFMessageErrorDomain error 1028.
    I can't seem to delete a message from my mailbox.  The above error message comes up every time and the message then reappears in my inbox.

    Back up all data. Rebuild the mailbox. Try to delete the message again. If you still can't, continue.
    From the Mail menu bar, select
    Mail > Preferences > Accounts > Advanced
    From the menu labeled
    Keep copies of messages for offline viewing
    choose
    Don't keep copies of any messages
    Close the window and save the change. Relaunch Mail and test.

  • What does this error message mean: "Filename: Mips32.ari TFTP Error: 'File not found' in AP-105"?

    Question: What does this error message mean: "Filename: Mips32.ari TFTP Error: ‘File not found’ in AP-105"?
    Product and Software: This article applies to AP-105.
    The root cause of this error is that the AP cannot perform a code upgrade.
    Scenario 1
    Check the ArubaOS code.
    The minimum requirement to bring up an AP-105 is ArubaOS 3.3.3+ or ArubaOS 3.4.1+.
    If the controller is running pre 3.3.3 code, upgrade the code to fix the issue.
    Scenario 2
    If the AP is not connected to the controller directly, bring up the AP in the controller and then connect it to the desired location. This process loads mips32.ari to the AP so that the AP can upgrade the code.
    Scenario 3
    The AP has no power adapter and you want to use the PoE feature. A few controller series like the 200 and 3000 Series do not support PoE. In this case, the AP cannot be terminated physically in the controller. Instead, connect the AP to the PoE switch, which is connected to the controller. Then assign a static IP configuration for the AP using the following commands:
    apboot> setenv ipaddr <ip address>
    apboot> setenv netmask <netmask>
    apboot> setenv gatewayip <ip address of the gateway>
    apboot> setenv master <ip address of the master>
    apboot> setenv serverip <ip address of the TFTP server>
    apboot> setenv bootcmd tftp
    apboot> save
    apboot> boot
    Locally configure the TFTP server for the AP and load the mips32.ari file from the controller with the help of the TFTP application.

    I want to download this file Mips32.ari for AP-105 device. Please give me this file download link. APBoot 1.2.4.4 (build 26618)
    Built: 2011-01-07 at 13:42:04Model: AP-10x
    CPU: AR7161 revision: A2
    Clock: 680 MHz, DDR clock: 340 MHz, Bus clock: 170 MHz
    DRAM: 128 MB
    POST1: passed
    Copy: done
    Flash: 16 MB
    PCI: scanning bus 0 ...
    dev fn venID devID class rev MBAR0 MBAR1 MBAR2 MBAR3
    00 00 168c 0029 00002 01 10000000 00000000 00000000 00000000
    01 00 168c 0029 00002 01 10010000 00000000 00000000 00000000
    Net: eth0
    Radio: ar922x#0, ar922x#1Hit <Enter> to stop autoboot: 0
    Checking image @ 0xbf100000
    Invalid image format version: 0xffffffff
    Checking image @ 0xbf800000
    Invalid image format version: 0xffffffff
    eth0 up: 1 Gb/s full duplex
    DHCP broadcast 1
    DHCP IP address: 192.168.x.xx
    DHCP subnet mask: 255.255.255.0
    DHCP def gateway: 192.168.x.xx
    DHCP DNS server: 192.168.x.xx
    DHCP DNS domain: xx
    ADP multicast 1
    ADP broadcast 1
    ADP multicast 2
    checksum bad
    ADP broadcast 2
    checksum bad
    ADP multicast 3
    checksum bad
    checksum bad
    checksum badRetry count exceeded
    DNS request 1 for aruba-master to 192.168.x.xx
    checksum bad
    checksum bad
    checksum bad
    T Using eth0 device
    TFTP from server 192.168.x.xx; our IP address is 192.168.x.xx
    Filename 'mips32.ari'.
    Load address: 0x2000000
    Loading: checksum bad
    T T checksum bad
    T checksum bad
    checksum bad
    checksum bad
    T checksum bad
    checksum bad
    T T checksum bad
    T checksum bad
    checksum bad
    T T T
    Retry count exceeded; starting again
    eth0 up: 1 Gb/s full duplex
    checksum bad
    checksum bad
    checksum bad
    checksum bad
    checksum bad
    checksum bad
    checksum bad
    checksum bad
    checksum bad
    checksum bad
    checksum bad
    checksum bad
    checksum bad
    checksum bad
    checksum bad
    checksum bad
    checksum bad
    checksum badARP Retry count exceeded; starting again
    eth0 up: 1 Gb/s full duplexchecksum bad
    checksum bad
    checksum bad
    checksum bad
    checksum bad
    checksum bad
    checksum bad
    checksum bad  ThanKs :)
     

Maybe you are looking for

  • Apple TV keeps restarting/rebooting in an almost endless loop

    So this is the second ATV I have setup in the last two weeks. All iTunes/Mac OS software is up to date. ATV comes installed with 2.4. I have been able to set it up, stream, sync, control with Remote, etc. However this time the problem occurred about

  • Calling https web service from pl/sql

    hi, i've to call a web service from my database, after some research, i've tryed to use utl_dbws package to get the job, i've managed to put to work some of the examples i saw, that allways use http. My webservice is invoked using https with some use

  • How do i search for a string in a txt file using java??

    How do i search for a string in a txt file using java?? could you please help thanks J

  • Release Invoice MRBR (Blocked for payment)

    Hello MM Experts I am handling one issue that is related to release blocked invoice. In my case invoice is blocked due to price difference though there is no price difference IN sceduling agreement, GR and invoice. when we go to MRBR to release invoi

  • Focus on first item on the page

    Allthough I have this setting activated for my login page and my first item is user name, the focus is set to password. Is there anything I forgot? Funny enough, on one of my other applications works right. Denes Kubicek