What would be the Regex expression to get the first letter after a group of character and some integers?Regex for numbers onlyConverting user input string to regular expressionRegular expression to extract text between square bracketsRegular Expression: Any character that is NOT a letter or numberIs there a RegExp.escape function in Javascript?How to extract a substring using regexGreedy vs. Reluctant vs. Possessive QuantifiersReplace only some groups with Regexd is less efficient than [0-9]How to use Regular Expressions (Regex) in Microsoft Excel both in-cell and loops

A life of PhD: is it feasible?

Is there a better way to do partial sums of array items in JavaScript?

Problem with pronounciation

What does the homotopy coherent nerve do to spaces of enriched functors?

Realistic, logical way for men with medieval-era weaponry to compete with much larger and physically stronger foes

Makefile for a simple Debian Repo

How much web presence should I have?

How to make a composition of functions prettier?

Why does there seem to be an extreme lack of public trashcans in Taiwan?

Was planting UN flag on Moon ever discussed?

Are the guests in Westworld forbidden to tell the hosts that they are robots?

Why are ambiguous grammars bad?

Why would a home insurer offer a discount based on credit score?

What's the best way to quit a job mostly because of money?

In The Incredibles 2, why does Screenslaver's name use a pun on something that doesn't exist in the 1950s pastiche?

Parsing text written the millitext font

What is the STRONGEST end-of-line knot to use if you want to use a steel-thimble at the end, so that you've got a steel-eyelet at the end of the line?

What does this line mean in Zelazny's "The Courts of Chaos"?

How many sets of dice do I need for D&D?

How to generate list of *all* available commands and functions?

How do I avoid typing "git" at the begining of every Git command?

How can you estimate a spike story?

What is the proper event in Extended Events to track stored procedure executions?

Professor Roman loves to teach unorthodox Chemistry



What would be the Regex expression to get the first letter after a group of character and some integers?


Regex for numbers onlyConverting user input string to regular expressionRegular expression to extract text between square bracketsRegular Expression: Any character that is NOT a letter or numberIs there a RegExp.escape function in Javascript?How to extract a substring using regexGreedy vs. Reluctant vs. Possessive QuantifiersReplace only some groups with Regexd is less efficient than [0-9]How to use Regular Expressions (Regex) in Microsoft Excel both in-cell and loops






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








1















I have a string that the following structure:



ABCD123456EFGHIJ78 but sometimes it's missing a number or a character like:



ABC123456EFGHIJ78 or
ABCD123456E or
ABCD12345EFGHIJ78
etc.



That's why I need regular expressions.



What I want to extract is the first letter of the third group, in this case 'E'.



I have the following regex:



(D+)+(d+)+(D1)3


but I don't get the letter E.










share|improve this question

















  • 2





    See regex101.com/r/5GA6YQ/1

    – Wiktor Stribiżew
    Mar 22 at 18:27

















1















I have a string that the following structure:



ABCD123456EFGHIJ78 but sometimes it's missing a number or a character like:



ABC123456EFGHIJ78 or
ABCD123456E or
ABCD12345EFGHIJ78
etc.



That's why I need regular expressions.



What I want to extract is the first letter of the third group, in this case 'E'.



I have the following regex:



(D+)+(d+)+(D1)3


but I don't get the letter E.










share|improve this question

















  • 2





    See regex101.com/r/5GA6YQ/1

    – Wiktor Stribiżew
    Mar 22 at 18:27













1












1








1


0






I have a string that the following structure:



ABCD123456EFGHIJ78 but sometimes it's missing a number or a character like:



ABC123456EFGHIJ78 or
ABCD123456E or
ABCD12345EFGHIJ78
etc.



That's why I need regular expressions.



What I want to extract is the first letter of the third group, in this case 'E'.



I have the following regex:



(D+)+(d+)+(D1)3


but I don't get the letter E.










share|improve this question














I have a string that the following structure:



ABCD123456EFGHIJ78 but sometimes it's missing a number or a character like:



ABC123456EFGHIJ78 or
ABCD123456E or
ABCD12345EFGHIJ78
etc.



That's why I need regular expressions.



What I want to extract is the first letter of the third group, in this case 'E'.



I have the following regex:



(D+)+(d+)+(D1)3


but I don't get the letter E.







regex






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Mar 22 at 18:25









esgesg

255




255







  • 2





    See regex101.com/r/5GA6YQ/1

    – Wiktor Stribiżew
    Mar 22 at 18:27












  • 2





    See regex101.com/r/5GA6YQ/1

    – Wiktor Stribiżew
    Mar 22 at 18:27







2




2





See regex101.com/r/5GA6YQ/1

– Wiktor Stribiżew
Mar 22 at 18:27





See regex101.com/r/5GA6YQ/1

– Wiktor Stribiżew
Mar 22 at 18:27












2 Answers
2






active

oldest

votes


















2














This seems to work for the example cases you provided.



^(?:[A-Za-z]+)(?:d+)(.)


It assumes that the first group is only letters and that the second group is only digits.






share|improve this answer






























    0














    There's already a nice answer.



    But for the records, your initial proposal was very close to work. You just needed to say that the character matching the 3rd group can repeat several times by adding a star:



    ^(D+)(d+)(D1)3*


    The main weakness is that D matches any char except digits, so also spaces. Making it more robust leads us to explicit the range of chars accepted:



    ^([A-Za-z]+)(d+)([A-Za-z]1)3*


    It's much better, but my favourite uses w to match at the end of the pattern any non white character:



    ([A-Za-z]+)(d+)([A-Za-z]1)w*





    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%2f55305759%2fwhat-would-be-the-regex-expression-to-get-the-first-letter-after-a-group-of-char%23new-answer', 'question_page');

      );

      Post as a guest















      Required, but never shown

























      2 Answers
      2






      active

      oldest

      votes








      2 Answers
      2






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      2














      This seems to work for the example cases you provided.



      ^(?:[A-Za-z]+)(?:d+)(.)


      It assumes that the first group is only letters and that the second group is only digits.






      share|improve this answer



























        2














        This seems to work for the example cases you provided.



        ^(?:[A-Za-z]+)(?:d+)(.)


        It assumes that the first group is only letters and that the second group is only digits.






        share|improve this answer

























          2












          2








          2







          This seems to work for the example cases you provided.



          ^(?:[A-Za-z]+)(?:d+)(.)


          It assumes that the first group is only letters and that the second group is only digits.






          share|improve this answer













          This seems to work for the example cases you provided.



          ^(?:[A-Za-z]+)(?:d+)(.)


          It assumes that the first group is only letters and that the second group is only digits.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Mar 22 at 18:46









          Russ BrownRuss Brown

          1516




          1516























              0














              There's already a nice answer.



              But for the records, your initial proposal was very close to work. You just needed to say that the character matching the 3rd group can repeat several times by adding a star:



              ^(D+)(d+)(D1)3*


              The main weakness is that D matches any char except digits, so also spaces. Making it more robust leads us to explicit the range of chars accepted:



              ^([A-Za-z]+)(d+)([A-Za-z]1)3*


              It's much better, but my favourite uses w to match at the end of the pattern any non white character:



              ([A-Za-z]+)(d+)([A-Za-z]1)w*





              share|improve this answer



























                0














                There's already a nice answer.



                But for the records, your initial proposal was very close to work. You just needed to say that the character matching the 3rd group can repeat several times by adding a star:



                ^(D+)(d+)(D1)3*


                The main weakness is that D matches any char except digits, so also spaces. Making it more robust leads us to explicit the range of chars accepted:



                ^([A-Za-z]+)(d+)([A-Za-z]1)3*


                It's much better, but my favourite uses w to match at the end of the pattern any non white character:



                ([A-Za-z]+)(d+)([A-Za-z]1)w*





                share|improve this answer

























                  0












                  0








                  0







                  There's already a nice answer.



                  But for the records, your initial proposal was very close to work. You just needed to say that the character matching the 3rd group can repeat several times by adding a star:



                  ^(D+)(d+)(D1)3*


                  The main weakness is that D matches any char except digits, so also spaces. Making it more robust leads us to explicit the range of chars accepted:



                  ^([A-Za-z]+)(d+)([A-Za-z]1)3*


                  It's much better, but my favourite uses w to match at the end of the pattern any non white character:



                  ([A-Za-z]+)(d+)([A-Za-z]1)w*





                  share|improve this answer













                  There's already a nice answer.



                  But for the records, your initial proposal was very close to work. You just needed to say that the character matching the 3rd group can repeat several times by adding a star:



                  ^(D+)(d+)(D1)3*


                  The main weakness is that D matches any char except digits, so also spaces. Making it more robust leads us to explicit the range of chars accepted:



                  ^([A-Za-z]+)(d+)([A-Za-z]1)3*


                  It's much better, but my favourite uses w to match at the end of the pattern any non white character:



                  ([A-Za-z]+)(d+)([A-Za-z]1)w*






                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Mar 24 at 22:50









                  ChristopheChristophe

                  43.3k43883




                  43.3k43883



























                      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%2f55305759%2fwhat-would-be-the-regex-expression-to-get-the-first-letter-after-a-group-of-char%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

                      Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

                      SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

                      은진 송씨 목차 역사 본관 분파 인물 조선 왕실과의 인척 관계 집성촌 항렬자 인구 같이 보기 각주 둘러보기 메뉴은진 송씨세종실록 149권, 지리지 충청도 공주목 은진현