Listing word final consonants cluster in German Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 00:00UTC (8:00pm US/Eastern) Data science time! April 2019 and salary with experience The Ask Question Wizard is Live!How do I check if a list is empty?Finding the index of an item given a list containing it in PythonDifference between append vs. extend list methods in PythonRegular expression to match a line that doesn't contain a wordHow to make a flat list out of list of listsHow do I get the number of elements in a list in Python?How do I concatenate two lists in Python?How to clone or copy a list?How do I list all files of a directory?How to read a file line-by-line into a list?

Do wooden building fires get hotter than 600°C?

What is the appropriate index architecture when forced to implement IsDeleted (soft deletes)?

Amount of permutations on an NxNxN Rubik's Cube

Do I really need to have a message in a novel to appeal to readers?

As a beginner, should I get a Squier Strat with a SSS config or a HSS?

Why should I vote and accept answers?

Performance gap between vector<bool> and array

Trademark violation for app?

Using audio cues to encourage good posture

Did Deadpool rescue all of the X-Force?

Disembodied hand growing fangs

Is there hard evidence that the grant peer review system performs significantly better than random?

Do any jurisdictions seriously consider reclassifying social media websites as publishers?

Question about debouncing - delay of state change

Why weren't discrete x86 CPUs ever used in game hardware?

A term for a woman complaining about things/begging in a cute/childish way

Is a ledger board required if the side of my house is wood?

SF book about people trapped in a series of worlds they imagine

Why wasn't DOSKEY integrated with COMMAND.COM?

What is the topology associated with the algebras for the ultrafilter monad?

Selecting user stories during sprint planning

Has negative voting ever been officially implemented in elections, or seriously proposed, or even studied?

How do living politicians protect their readily obtainable signatures from misuse?

What does it mean that physics no longer uses mechanical models to describe phenomena?



Listing word final consonants cluster in German



Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 23, 2019 at 00:00UTC (8:00pm US/Eastern)
Data science time! April 2019 and salary with experience
The Ask Question Wizard is Live!How do I check if a list is empty?Finding the index of an item given a list containing it in PythonDifference between append vs. extend list methods in PythonRegular expression to match a line that doesn't contain a wordHow to make a flat list out of list of listsHow do I get the number of elements in a list in Python?How do I concatenate two lists in Python?How to clone or copy a list?How do I list all files of a directory?How to read a file line-by-line into a list?



.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








1















I wrote a program that finds and counts initial consonant clusters in German and Spanish texts. I want a regex that will find clusters on final positions. Using b or $ does not work. Can someone help me determine how I should change my regex so that it will work for final consonants clusters?



I currently have sth like this for initial clusters:



for w in words:
initial = re.search('^([^aeiouy]*)[aeiouy]',w)


Or sth like this:



 initial = re.search('^[^aeiouy]2,',w)









share|improve this question



















  • 1





    Try re.search(r'[^aeiouy]2,b', w) or re.search(r'[^aeiouy]+$', w)

    – Wiktor Stribiżew
    Mar 8 at 20:29












  • Actually, already tried that and the outcome of using it is just a list of words with frequency. I am looking for sth like in English 'singing' - the outcome should be: 'ng' cluster. So now that I am thinking maybe it should be a code more like this: (?:(?![aeiou])[a-z])2, but with modification to final cluster, still doesn't work

    – White
    Mar 8 at 20:43











  • Try (?:(?![aeiou])[a-z])2,$, see demo.

    – Wiktor Stribiżew
    Mar 8 at 20:44












  • Thank you very much for your help!

    – White
    Mar 8 at 20:47

















1















I wrote a program that finds and counts initial consonant clusters in German and Spanish texts. I want a regex that will find clusters on final positions. Using b or $ does not work. Can someone help me determine how I should change my regex so that it will work for final consonants clusters?



I currently have sth like this for initial clusters:



for w in words:
initial = re.search('^([^aeiouy]*)[aeiouy]',w)


Or sth like this:



 initial = re.search('^[^aeiouy]2,',w)









share|improve this question



















  • 1





    Try re.search(r'[^aeiouy]2,b', w) or re.search(r'[^aeiouy]+$', w)

    – Wiktor Stribiżew
    Mar 8 at 20:29












  • Actually, already tried that and the outcome of using it is just a list of words with frequency. I am looking for sth like in English 'singing' - the outcome should be: 'ng' cluster. So now that I am thinking maybe it should be a code more like this: (?:(?![aeiou])[a-z])2, but with modification to final cluster, still doesn't work

    – White
    Mar 8 at 20:43











  • Try (?:(?![aeiou])[a-z])2,$, see demo.

    – Wiktor Stribiżew
    Mar 8 at 20:44












  • Thank you very much for your help!

    – White
    Mar 8 at 20:47













1












1








1








I wrote a program that finds and counts initial consonant clusters in German and Spanish texts. I want a regex that will find clusters on final positions. Using b or $ does not work. Can someone help me determine how I should change my regex so that it will work for final consonants clusters?



I currently have sth like this for initial clusters:



for w in words:
initial = re.search('^([^aeiouy]*)[aeiouy]',w)


Or sth like this:



 initial = re.search('^[^aeiouy]2,',w)









share|improve this question
















I wrote a program that finds and counts initial consonant clusters in German and Spanish texts. I want a regex that will find clusters on final positions. Using b or $ does not work. Can someone help me determine how I should change my regex so that it will work for final consonants clusters?



I currently have sth like this for initial clusters:



for w in words:
initial = re.search('^([^aeiouy]*)[aeiouy]',w)


Or sth like this:



 initial = re.search('^[^aeiouy]2,',w)






python regex cluster-computing final






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 8 at 20:44









marchoy

16918




16918










asked Mar 8 at 20:28









WhiteWhite

83




83







  • 1





    Try re.search(r'[^aeiouy]2,b', w) or re.search(r'[^aeiouy]+$', w)

    – Wiktor Stribiżew
    Mar 8 at 20:29












  • Actually, already tried that and the outcome of using it is just a list of words with frequency. I am looking for sth like in English 'singing' - the outcome should be: 'ng' cluster. So now that I am thinking maybe it should be a code more like this: (?:(?![aeiou])[a-z])2, but with modification to final cluster, still doesn't work

    – White
    Mar 8 at 20:43











  • Try (?:(?![aeiou])[a-z])2,$, see demo.

    – Wiktor Stribiżew
    Mar 8 at 20:44












  • Thank you very much for your help!

    – White
    Mar 8 at 20:47












  • 1





    Try re.search(r'[^aeiouy]2,b', w) or re.search(r'[^aeiouy]+$', w)

    – Wiktor Stribiżew
    Mar 8 at 20:29












  • Actually, already tried that and the outcome of using it is just a list of words with frequency. I am looking for sth like in English 'singing' - the outcome should be: 'ng' cluster. So now that I am thinking maybe it should be a code more like this: (?:(?![aeiou])[a-z])2, but with modification to final cluster, still doesn't work

    – White
    Mar 8 at 20:43











  • Try (?:(?![aeiou])[a-z])2,$, see demo.

    – Wiktor Stribiżew
    Mar 8 at 20:44












  • Thank you very much for your help!

    – White
    Mar 8 at 20:47







1




1





Try re.search(r'[^aeiouy]2,b', w) or re.search(r'[^aeiouy]+$', w)

– Wiktor Stribiżew
Mar 8 at 20:29






Try re.search(r'[^aeiouy]2,b', w) or re.search(r'[^aeiouy]+$', w)

– Wiktor Stribiżew
Mar 8 at 20:29














Actually, already tried that and the outcome of using it is just a list of words with frequency. I am looking for sth like in English 'singing' - the outcome should be: 'ng' cluster. So now that I am thinking maybe it should be a code more like this: (?:(?![aeiou])[a-z])2, but with modification to final cluster, still doesn't work

– White
Mar 8 at 20:43





Actually, already tried that and the outcome of using it is just a list of words with frequency. I am looking for sth like in English 'singing' - the outcome should be: 'ng' cluster. So now that I am thinking maybe it should be a code more like this: (?:(?![aeiou])[a-z])2, but with modification to final cluster, still doesn't work

– White
Mar 8 at 20:43













Try (?:(?![aeiou])[a-z])2,$, see demo.

– Wiktor Stribiżew
Mar 8 at 20:44






Try (?:(?![aeiou])[a-z])2,$, see demo.

– Wiktor Stribiżew
Mar 8 at 20:44














Thank you very much for your help!

– White
Mar 8 at 20:47





Thank you very much for your help!

– White
Mar 8 at 20:47












1 Answer
1






active

oldest

votes


















0














You seem to want to extract chunks of 2 or more consonant letters at the end of the string.



You may use



(?:(?![aeiou])[a-z])2,$


See the regex demo.



Details




  • (?: - start of a non-capturing group:


    • (?![aeiou]) - a negative lookahead that fails the match if the next char is a vowel


    • [a-z] - an ASCII letter (case insensitive mode can be set with re.I flag)



  • )2, - end of the group, 2 or more occurrences


  • $ - end of string.





share|improve this answer























    Your Answer






    StackExchange.ifUsing("editor", function ()
    StackExchange.using("externalEditor", function ()
    StackExchange.using("snippets", function ()
    StackExchange.snippets.init();
    );
    );
    , "code-snippets");

    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "1"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55070540%2flisting-word-final-consonants-cluster-in-german%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    You seem to want to extract chunks of 2 or more consonant letters at the end of the string.



    You may use



    (?:(?![aeiou])[a-z])2,$


    See the regex demo.



    Details




    • (?: - start of a non-capturing group:


      • (?![aeiou]) - a negative lookahead that fails the match if the next char is a vowel


      • [a-z] - an ASCII letter (case insensitive mode can be set with re.I flag)



    • )2, - end of the group, 2 or more occurrences


    • $ - end of string.





    share|improve this answer



























      0














      You seem to want to extract chunks of 2 or more consonant letters at the end of the string.



      You may use



      (?:(?![aeiou])[a-z])2,$


      See the regex demo.



      Details




      • (?: - start of a non-capturing group:


        • (?![aeiou]) - a negative lookahead that fails the match if the next char is a vowel


        • [a-z] - an ASCII letter (case insensitive mode can be set with re.I flag)



      • )2, - end of the group, 2 or more occurrences


      • $ - end of string.





      share|improve this answer

























        0












        0








        0







        You seem to want to extract chunks of 2 or more consonant letters at the end of the string.



        You may use



        (?:(?![aeiou])[a-z])2,$


        See the regex demo.



        Details




        • (?: - start of a non-capturing group:


          • (?![aeiou]) - a negative lookahead that fails the match if the next char is a vowel


          • [a-z] - an ASCII letter (case insensitive mode can be set with re.I flag)



        • )2, - end of the group, 2 or more occurrences


        • $ - end of string.





        share|improve this answer













        You seem to want to extract chunks of 2 or more consonant letters at the end of the string.



        You may use



        (?:(?![aeiou])[a-z])2,$


        See the regex demo.



        Details




        • (?: - start of a non-capturing group:


          • (?![aeiou]) - a negative lookahead that fails the match if the next char is a vowel


          • [a-z] - an ASCII letter (case insensitive mode can be set with re.I flag)



        • )2, - end of the group, 2 or more occurrences


        • $ - end of string.






        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Mar 8 at 20:56









        Wiktor StribiżewWiktor Stribiżew

        331k16149232




        331k16149232





























            draft saved

            draft discarded
















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55070540%2flisting-word-final-consonants-cluster-in-german%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Save data to MySQL database using ExtJS and PHP [closed]2019 Community Moderator ElectionHow can I prevent SQL injection in PHP?Which MySQL data type to use for storing boolean valuesPHP: Delete an element from an arrayHow do I connect to a MySQL Database in Python?Should I use the datetime or timestamp data type in MySQL?How to get a list of MySQL user accountsHow Do You Parse and Process HTML/XML in PHP?Reference — What does this symbol mean in PHP?How does PHP 'foreach' actually work?Why shouldn't I use mysql_* functions in PHP?

            Compiling GNU Global with universal-ctags support Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) Data science time! April 2019 and salary with experience The Ask Question Wizard is Live!Tags for Emacs: Relationship between etags, ebrowse, cscope, GNU Global and exuberant ctagsVim and Ctags tips and trickscscope or ctags why choose one over the other?scons and ctagsctags cannot open option file “.ctags”Adding tag scopes in universal-ctagsShould I use Universal-ctags?Universal ctags on WindowsHow do I install GNU Global with universal ctags support using Homebrew?Universal ctags with emacsHow to highlight ctags generated by Universal Ctags in Vim?

            Add ONERROR event to image from jsp tldHow to add an image to a JPanel?Saving image from PHP URLHTML img scalingCheck if an image is loaded (no errors) with jQueryHow to force an <img> to take up width, even if the image is not loadedHow do I populate hidden form field with a value set in Spring ControllerStyling Raw elements Generated from JSP tagds with Jquery MobileLimit resizing of images with explicitly set width and height attributeserror TLD use in a jsp fileJsp tld files cannot be resolved