Simple Regex problem with symbols

I need split a text and get only the words, numbers and hyphenated compounds-words. I need to get words from latin too, then I used \p{L}, which gives me e u u a and so on. The example is:

String myText = "of the latin text with symbols? 987 (cutting-edge Southeast of the island stands the Notre-Dame Cathedral, which was at its completion in 1330, one of the largest cathedrals West):! @ # $ % ^& * ( ) + - _ #$% " ' : ; > < /--------| "here some is wrong... * + (e)-

Pattern pattern = Pattern.compile("[^\\p{L}+(\\-\\p{L}+)*\\d]+"); "
String of words [] = pattern.split (myText);

What is the problem with this regex? Why it matches symbols like "(", "+", "-", "*" et "|"?) "

Some results are:

dress / / OK
Southeast / / OK
West) / / BAD
987 / / OK
() / / BAD
(a / / BAD)
* / / BAD
-/ / BAD
+ / / BAD
(/ / BAD)
| EVIL

P.S.:
The explanation of the regex is:

[^ \p {L} + (\-\p {L} +) * \d] +

* Word breaker will be:
* [^  ...  ] No sequence in:
* \p{L}+ any Latin letter
* (\-\p{L}+)* possibly a hyphen)
* \d or numbers
* [...] + one or more times.

Try to divide as it will always be difficult as you try to match what you don't want. I would use Pattern.find () looking for things I want. Something like


       Pattern p = Pattern.compile("(\\p{L}+([-']\\p{L}+)*)|\\d+");
            Matcher m = p.matcher(myText);
        while (m.find())
        {
            System.out.println(m.group());
        }

Tags: Java

Similar Questions

  • Annoying problem with symbols

    When I'm in a scene, and then double-click the symbol on the stage in order to change it, it works except that the background is not grey out as it should. It's, it's more difficult to focus on my symbol which is very annoying. Help?

    Well, I'm editing. I open a file with this problem, copied frames and pasted into a new document. Problem did not exist in the new document. So I started to look for differences. Oddly, the view > preview mode seems to have an effect. When set to Full, the change in place does not diminish the rest of the film. Together in another setting, such as the anti-aliasing text, solves the problem. Obviously, this setting disables the "dim" edit-in-place capability.

    I would like to know if it works for you. I'm curious why this whole shebang has this effect. I saw other comments on this question without answers, so that makes me a learned fool (I am certainly not much less to find that).

  • I have problem with symbols

    Hello

    When I create a symbol:

    1.I cannot review in the "library" window

    2.i cannot drag the shape I want to display

    3 when I drag to the screen, the previous symbol is not a symbol more

    I captured a video that shows my problem

    Here it is:

    http://www.swfcabin.com/open/1269186631

    Windowns XP-Flash CS4

    How can I solve this problem?

    Thank you

    Hmm I guess theres an easier way, but what you can try is rather than to copy objects on stage copy all the images in the time line, then new symbol then paste the images into the scenario of the symbol. Then must keep all the layers in the same order.

  • Simple (?) problems with &amp; quot; IF &amp; quot; instructions and variables! Help, please...

    Nested in a couple of layers down in my film, I have a form with 2 fields and a check box and a submit button (the submit button is actually just a clip rather than any actual server-side).

    What I want TO ask you is for the clip NOT to play unless THE 3 elements have been 'used', that is to say: BOTH fields have SOME copy and for the check box.
    If all THE 3 criteria HAVE been met, so the video should play.

    Before we get to this form, 3 variables are assigned additional in the timeline, a couple of levels:
    step4a = "";
    step4b = "";
    step4e = 'off ';


    Back in my form, 2 blank fields have 'Var's called step4aName and step4bEmail.
    By clicking on the button box checkbox sets the step4e variable to 'on '.

    The following code is related to the Submit button:
    on (release) {}
    FIRST VARIABLE HAS THE VALUE FIELD FIRST MATCH
    _parent._parent.step4a = step4aName;
    SECOND VARIABLE HAS THE SECOND MATCH FIELD VALUE
    _parent._parent.step4b = step4bEmail;
    ORDERS OF TRACE FOR THE ERROR CHECKING
    trace ("step4a =" + _parent._parent.step4a);
    trace ("step4b =" + _parent._parent.step4b);
    trace ("step4e =" + _parent._parent.step4e);
    DON'T PLAY THAT CLIP IF THE TWO FIELDS ARE FILLED AND THE BOX IS CHECKED
    If ((_parent._parent.step4a! = "") & &)
    (_parent._parent.step4b! = "") & &
    (_parent._parent.step4e == "on")) {
    This.Play ();
    }
    }


    When I test the movie, I get the following output (which is what I expected, implying that everything is fine):
    step4a =
    step4b =
    step4e = off


    Now what happens when I run the present, it is that the clip will be, quite rightly, NOT play, if I just hit send without do something else first. But the problem comes when I ONLY check the check box and then click on submit, because then the FACT clip play, when he's NOT supposed to. Why? My two fields ARE still empty as prove it track orders that I issued when I hit the submit button - they say again:
    step4a =
    step4b =


    To further complicate things, if I AM typing something in the 2 fields, but I then delete what I typed, then the clip will be properly NOT play (with the check mark). The two issued variables still say:
    step4a =
    step4b =

    (And if I type text in 2 text fields, then 2 outlines variables IS updated to contain the text that corresponds to what I type in.)

    So according to the output that I see, how I put it together work SHOULD , but it's not.

    So to summarize, the problem is, if I LET my 2 fields completely empty, as it appears on the screen, then my error checking does not work.
    If I type something in my fields, then DO the virgins by deleting the text in there, then my work of error checking as it should.
    What is happening with this?

    Hi Brett, I don't know what version of flash/as (this applies only to later versions) you use, but you may first consider place this code in a keyframe on the timeline and use
    pathto.button.onRelease = function() {}
    code
    }
    and by changing your fields to a syntax that is similar.

    Possible your error checking does not work it is because NULL values and ' ' values differ... when the first load of the text box the value NULL is that no value has been entered. The process of adding text and removing leaves a value of ' '-c' is an empty string which meets your requirements.

    to resolve this problem, you could add NULL to your state of health, for example

    If (((_parent._parent.step4a! = "") OR (_parent._parent.step4a.) (= NULL))
    &&
    ((_parent._parent.step4b! = "") OR (_parent._parent.step4b.) (= NULL))
    &&
    (_parent._parent.step4e == "on"))

    or of course if you just use a newer version of flash test

    my_Text.length > 0

    I hope this helps

    Sam

  • Problem with some fonts of symbols after the installation of the Sierra

    Hello

    I have recently upgraded the OS on my iMac late 2012 for Sierra, since doing so, I noticed a problem with several fonts.

    All symbolic symbols Apple to Wingdings fonts not correctly displayed in the font book. Apple symbols looks like a standard wheelbase of san, and other symbolic fonts just show as question marks '?' where the images should be.

    In text editing, that I can't even see the symbolic fonts like Zapf Dingbats and Wingdings in the selector. However, they all work well in Adobe Illustrator (CS5) and Microsoft Word 2011. Apple symbols still looks like a standard font.

    I already tried the following:

    1. check the fonts in font book

    2 fix the duplicates in the font book

    3. using the "Restore Standard fonts" option in the font book

    4 deleting a file in the folder Preferences plist Fonts

    5 deleted the cache of police and the database

    I'm out of ideas. Has anyone else had the same problem found a fix?

    Kind regards

    Greville

    I'm just to add that I used the recovery partition to do a clean install of Sierra on a hard drive external and then booted into it to see if it had the same problem.

    And he does. Wingdings and other photo fonts appear as '?' in boxes where the letters must be in the font book.

    So this seems like a problem with the way Sierra displays these fonts, not with the font files themselves.

  • Problem with a simple integral

    Hi all

    I have 2 problems with a simple integral, and I do not understand how the first HP solves.

    My first problem is that if I add a constant before my variable, the answer becomes really weird.

    My second problem is that if I just change one letter (q becomes Q), the answer changes completely.

    I am attaching a picture of the calculations so that you can understand my problem.

    Thank you very much for your help

    Kind regards

    Xavier

    When you type wx you now have a variable named "wx" - not w * x which is what I suspect you intend. You must manually add a multiplication between them.

    When you use the Q, you are actually using the predefined global real variable that is most likely the value 0. If you've stored 2 in Q, I suspect that you'll get a different result. Remember that all variables in capital letters from A to Z and THETA and already defined as real numbers. VARS-> HOME-> REAL-press and you will see them.

  • Problem with Simple Contact form fields do not come into the home.

    Hello

    The form of a Simple Contact on our site is not letting users enter their names and e-mail addresses.  The other fields for cell phone and Message are working well.

    I though this might be a problem with the hosting, but the site is hosted on Business Catalyst (badfishy.businesscatalyst.com).

    I created other test sites and insert the Simple Contact form which worked perfectly, so I'm not sure what I did to the main site to cause this problem.

    Any help would be appreciated muchly.

    See you soon

    Ben

    Hi Ben

    I checked the site and it seems that the frame of the accordion is extended to the covering page so 2 fields in form because of which fields are not active because they are behind the plot of the accordion.

    Please reduce the accordion framework such as the fields of the form are not behind the frame and then it should work.

    Thank you

    Sanjit

  • Problem with the simple query.

    Hi all

    I am facing problem with the query below

    Select A.COL1, A.COL2

    B.COL1, B.COL2

    FROM TABLE1 A

    TABLE 1 B

    WHERE A.header = '123'

    AND B.header = '123'

    AND nvl (A.COL6, 'ABC') = 'ABC '.

    AND NVL (B.COL6, 'DEF') = 'DEF '.

    Basically, my requiremenyt is: I have only one table, TABLE1 here, which has a line two lines (for the same header) as "ABC" and another is "DEF". Table 1 has two columns (col1, col2) that should be displayed for both lines.

    When the header has two records in table1 top query works. and but if I do not have a record for any header example there are a record for "abc" in col6 only. so my query above does not work because there is no record for 'DEF' in col6. But I want to again request to fecth the output (for b.col1 and b.col2 should have null values)

    could you pls suggest me how to get the 4 columns.

    Thanks in advance

    Kind regards

    UVA.

    Try to place the status of outer join on column: analytical_criterion_code as

    and nvl (AUDIT.analytical_criterion_code, 'AUDIT2') = 'verification2. '

    .

    .

    and nvl (TRANS.analytical_criterion_code, 'TRANS2') = 'TRANS2.

    In the sub query based on the opinions that you have given in post # 1, although there is no value "DEF * ' for col6 due to the condition of outer join on b.col6 (+) line is extracted with b.col [1,2,3] as NULL values. Try to remove the (+) sign b.col6 and test.

    with t as)

    Select 111 col1, col2 'aaa', 'ABC' col6 123 header of all the double union

    Select 222 'bbb', 'DEF' col6, 123 double header

    )

    q as (select 123 double header)

    Select A.COL1, A.COL2, A.COL6

    B.COL1, B.COL2, b.COL6

    q.header

    T a

    t b

    q

    where a.col6 (+) = 'ABC '.

    and b.col6 (+) = "DEF."

    and q.header = a.header (+)

    and q.header = b.header (+)

  • Problem with cursor - will switch to a link

    I was hoping that someone could help with this.

    My dad's Mac has a problem with the cursor. It uses the trackpad and when you try to click on a link, it will not work. The arrow does not change into a symbol of the 'hand' and it can not click on it. This makes it almost impossible to navigate. It seems that the links are not recognized. He tried to use a mouse via the USB port and nothing changes.

    He tried to update to El Captain but he can't because the mouse doesn't work. The simple, restart or turn off / suite does not work. The problem persists on Chrome and Safari.

    Any help appreciated, thanks.

    Hi Irbea,

    Thank you for using communities of Apple Support. I see that you are the dad had problems with clicking on the links on his MacBook. These are some great troubleshooting steps to try to solve this problem. I am happy using.

    According to the steps that he has already done, I'll try to test this in safe mode. This will allow his MacBook making some changes and prevent the loading of the software. Please follow these steps to safe mode:

    Try safe mode if your Mac does not end commissioning

    While you are in safe mode, you may notice that the MacBook is running slower or the screen flashes.  No worries, it's normal.  Read this article for more information about this:

    Graphics performance limited in recovery of OS X or in safe mode

    If you continue to have problems trying to test in a new user:

    How to test a question in another account on your Mac.

    Have a great day!

  • problem with a block of memory in labview 2009

    Hi all

    I have "ERROR: MapLib:979 - LUT4 symbol" during the compilation process (lots of errors like this), and I discovered that the reason of my problem is block of MEMORY.

    To be sure that the problem is in this block, I did a very simple project in LabView 2009 (on FPGA Target PCI5640R) only with the use of this block you can see in the photo, as well as in file test_memory block.lvproj attached link: https://www.dropbox.com/sh/u87f1oihelmm4dq/Jo_6-bICSf

    I have a problem with compiling VI with this block, and I have so many errors like:

    ERROR: MapLib:979 - LUT4 symbol
    "window/Thatcher/n_00000036/nSCTL_00000013_00000014/n_000000A3/cOutLoc<0>1.
    (output = window/Thatcher/res000001ed_wi<2>) is the input signal
    "window/Thatcher/res0000020d_wo<1>" that will be deleted. See Section 5 of the
    Map a report file to find out why the input signal will become conveyors.

    or

    ERROR: MapLib:978 - LUT4 symbol
    "window/Thatcher/n_00000036/nSCTL_00000013_00000014/n_000000A3/cOutLoc<23>1.
    (output = window/Thatcher/res000001ed_wi<25>) is an equation that uses
    input pin I2, which no longer has a connected signal. Make sure that all the
    the pins used in the equation for this LUT are signals that are not cut
    (see Section 5 of the report file map for details on which signals were
    adjusted).

    Entire report, you can see in the file report.txt on the attached link.

    I would appreciate if someone could take a look at my problem with simple project and suggest me a solution.

    I'm really stuck with my biggest project which need to have this memory block.

    I'm looking forward to hear from you,

    King looks

    ING. Damir Hamidovic

    Hi all

    I find a sollution to my problem.

    In memory-properties-general-setting up, I changed the block to look up Table memory, and I compile memory.vi and run it successfully.

    I did change as you can see on the picture:

    Just, can you tell me is it all "bad properties" and limits the use of this type of memory (Look up Table) of the implementation?

    King looks

  • Sound problems with HP TouchSmart Ultrabook 4-1118tu ENVY

    My Hp laptop suddenly has a problem with the sound; There is none!

    The message "no Audio output device is installed" appears when you move the speaker symbol.

    The laptop is now running Windows 8.1, but this problem happened weeks more than two months after it has been installed.

    Help, please!

    Hi all, well, I finally found a way to solve my problems of trawling other support pages and find tips on this page.

    http://h30434.www3.HP.com/T5/TouchSmart-PC/IDT-high-definition-audio-Windows-8-1/m-p/3012423#M21768

    Really, HP, you need to make it easier for people to solve their own problems when the corrections are as simple as that.

    I went to the Device Manager (be found easily by pressing the Windows key + X), open the "Sound" folder, right click on the device audio and selected "update drivers".

    Of course, I had weeks of no sound and the fix was simple, but not easy for people who use their computer with confidence, but aren't experts in their functions behind the scenes.

    I have someone else solve sound frustrations I had hope. "

  • There might be a problem with the configuration of your DOMAIN NAME SERVER

    Last week one, I noticed some problems with my internet connection. I have a BSNL broadband connection. I am connected to the internet, and after some time all of a sudden, I'm not able to connect. My modem lights are all on and on my laptop, I see the symbol of 2 computers with a note on it, which means that I'm connected. But still the pages not displayed. When I run Network Diagnostics (I Windown Vista) I get the error message saying: "there could be a problem with the configuration of your DOMAIN NAME server. I turned off the computer and the modem and switch it on after a long time... He would return but loses the connection with the same error message again. What can I do? I tried to reset the modem, also tried the system restore. What can I do? Please help me. I have laptop Dell Insipiron with Windows Vista and I connect wireless.

    We do not know how your system should be set up - including the DNS configuration and settings.  I recommend you contact your ISP's technical support group and get help from them in the configuration of your computer (and test lines and modem - the problem could be the modem and not on the computer or it could even be the service provider itself).  It can be something as simple as a typo or a box checked or not checked - I do not know because I do not know their settings (different for each access provider).  Give them a call.  I do so often when I have connection problems, and they are almost always useful, or schedule a service call if they cannot help.  I think it's your best chance to solve this problem.

    I hope this helps.

    Good luck!

    Lorien - MCSA/MCSE/network + / has + - if this post solves your problem, please click the 'Mark as answer' or 'Useful' button at the top of this message. Marking a post as answer, or relatively useful, you help others find the answer more quickly.

  • THE problem with banner publication. Undefined stage

    Hello

    We have the following problem with banner published cartoons of edge.

    TypeError: can't get goods 'stage' of reference\n undefined or null to init (http://animate.adobe.com/runtime/5.0.1/edge.5.0.1.min.jTypeError: could not get the goods 'stage' of reference\n undefined or null to init (http://animate.adobe.com/runtime/5.0.1/edge.5.0.1.min.j ))

    SCRIPT5007: Failed to get the goods 'step' of undefined reference or null

    File: edge.5.0.1.min.js, line: 133, column: 135

    Mistakes, that it only occurs in IE 11 if the animation does not load.

    Here is the hosted banner

    iShares Core

    Is a very simple animation, the only changes made on the inserted document ready function is an adserver requirements. However for the moment is commentated for test purposes

    End of binding edge

    {/ * Symbol.bindElementAction (compId, symbolName, "document", "compositionReady", Function (SYM, e)}

    function initEB() {if (!) EB.isInitialized ()) {EB.addEventListener (EBG. EventName.EB_INITIALIZED, startAd) ;} else {startAd ;}})

    function startAd() {sym.$("windowDisclaimer").hide ();sym.play() ;}

    initEB();

    });*/

    {Symbol.bindElementAction (compId, symbolName, "document", "compositionReady", function (sym, e)}

    Console.log ("compositionReady");

    SYM. Play();

    });

    I find that if I do not understand the library of EBloader. (Library of the ad server) the banner works well at some point, there is a conflict between edge and ebloader.

    http://DS.serving-sys.com/BurstingScript/EBLoader.js

    Thanks for the help

    Concerning

    Luis

    The solution I found that it was in the order of calling script.

    Call the EBLoader.js file before you call the file edge.x.x.x.min.js.

    THAT IS TO SAY:

  • InDesign on Mac with OS 10.8 CS6 have problems with links

    Hello

    InDesign on Mac with 10.8 CS6 have problems with links. All links to other files need to be updated when you open a file, although absolutely nothing has changed for linked files.
    We can exclude the networking of business and the system hosting the files (software on RedHat Linux VM HELIOS). This happens with the Indesign files newly created and 'old'. For example, we create a file Tuesday, save it and open it again on MAC same exact Wednesday and all links to other fields (.indd, .png, .bmp, etc. nothing rare) must be updated because they all show the yellow triangle + black exclamation point symbol next to them. Someone else knows that, what can we do? We have absolutely everything tried and updated all the software from MAC OS to CS6 itself, but nothing seems to help for the long term.

    For any information required?

    Mr. Miller

    Thanks for your quick response.
    In fact, we noticed that there also seems to be something wrong with the timestamps:
    If we open the news via the MAC finder to a file (.psd for example) which is linked to one of our indesign files, it has a certain date of creation.
    If we then switch to the Indesign file that we just opened in which we had to update all the links and open information to exactly the same file looked at us in the finder, another creation date is indicated. So there also seems to be a mistake here (hope it is clear what I mean).

    Our network we are excluding the error cannot be "re-enacted". We have created several test files in Indesign (simple white page with a link to a .psd file which is also used in one of the allegedly defective files) and opened on different MACs with different versions of the OS over the past few days/weeks, but unfortunately files open without notifications or errors.

    Just as a background: a few months ago the problem seems to occur between MACs with different OS, 10, 6-10, 8 first. A file that was created on a MAC 10.6 could not be opened without updating all the links on a 10.8 Mac is why we've updated everything to 10.8. The error will not occur for about 2-3 weeks but then reoccured again. ?

    Have you heard something similar?

  • Problems with the creation of new samples

    Hello

    I seem to have huge problems with get newly created real, etc. in my palette of shades. To be as detailed as possible about this problem I will inlcude the two links that I tried to follow along.

    http://www.Suite101.com/content/creating-pattern-fills-in-Adobe-Illustrator-a74636 -a simple guide to create new patterns of filling to ensure that I do not have anything wrong.

    http://www.vectordiary.com/Illustrator/bling-bling-text-effect-tutorial/ -guide of what I'm trying to do

    I am relatively new to this program so I could be overlooking something, but I'm sure I was as complete as possible with it. Every time without fail I have my bounding box invisible sent to the back layer more remote with no border or background, then drag it to my Swatches palette, that nothing is happening. I can drag in the symbols but that's all, nothing happens. Maybe is something that these tutorials have missed? Or I have to (I'll try and make as much sense here as possible) cut and remove all the model outside of the rectangle enclosing invisible (which I sent to the farthest back layer) and group them before dragging them from the palette of nuance? I use Illustrator CS3 if that helps at all.

    Any help would be much appreciated, it's driving me crazy

    This be added to your new swatches so quickly that you don't notice yet it is at the bottom of your color chart (scroll down).

    Looks like your boss is tracks filled with a gradient, so if this is the case you will not any offending items. Do a test by drawing a shape(eg: star) and this dragging to the Swatches palette, if it creates a mosaic of model that you probably have a faulty element within your original selection (for example: linked picture)...

    I would like also in color chart context menu choose > select unused nuances and delete those, so your progress can be better monitored.

Maybe you are looking for