elisp regular expression build problemRegular expression to match text within quotesTurn case sensitivity off in regular expression replacementProblem in writing regular expression for imenu-generic-expressionRegular expression matching group replacement not workingregular expression whole word replace, whitespace onlyHow to correctly write regular expression to match ASCII control charswhat does grave accent ` and aposrophe ' do in elisp regular expression?

Multirow in tabularx?

Email address etiquette - Which address should I use to contact professors?

As a 16 year old, how can I keep my money safe from my mother?

Withdrew when Jimmy met up with Heath

constant evaluation when using differential equations.

Generate Brainfuck for the numbers 1–255

Blocking people from taking pictures of me with smartphone

How does "Te vas a cansar" mean "You're going to get tired"?

What are the uses and limitations of Persuasion, Insight, and Deception against other PCs?

How can I solve for the intersection points of two ellipses?

In SQL Server, why does backward scan of clustered index cannot use parallelism?

Is this curved text blend possible in Illustrator?

A simple stop watch which I want to extend

Are differences between uniformly distributed numbers uniformly distributed?

Should I ask for permission to write an expository post about someone's else research?

How are you supposed to know the strumming pattern for a song from the "chord sheet music"?

Ex-contractor published company source code and secrets online

Double redundancy for the Saturn V LVDC computer memory, how were disagreements resolved?

What does Apple mean by "This may decrease battery life"?

Write an interpreter for *

What is my malfunctioning AI harvesting from humans?

Is it okay for a ticket seller to grab a tip in the USA?

elisp regular expression build problem

What does this double-treble double-bass staff mean?



elisp regular expression build problem


Regular expression to match text within quotesTurn case sensitivity off in regular expression replacementProblem in writing regular expression for imenu-generic-expressionRegular expression matching group replacement not workingregular expression whole word replace, whitespace onlyHow to correctly write regular expression to match ASCII control charswhat does grave accent ` and aposrophe ' do in elisp regular expression?






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








1















I have the following line :



mod_name func_name /users/username/workspace/path_name/file.c 283


I wanted to capture the 3rd and 4th entry in this line, I am able
to do that using regular expressions like so:
^(?:S+s)2(S+) ([0-9]+)



How do I translate this into a lisp regex ? so that elisp functions can
understand. I couldn't use the above regex into re-builder within emacs. Says it is an invalid expression. What am I doing wrong ?










share|improve this question
































    1















    I have the following line :



    mod_name func_name /users/username/workspace/path_name/file.c 283


    I wanted to capture the 3rd and 4th entry in this line, I am able
    to do that using regular expressions like so:
    ^(?:S+s)2(S+) ([0-9]+)



    How do I translate this into a lisp regex ? so that elisp functions can
    understand. I couldn't use the above regex into re-builder within emacs. Says it is an invalid expression. What am I doing wrong ?










    share|improve this question




























      1












      1








      1


      1






      I have the following line :



      mod_name func_name /users/username/workspace/path_name/file.c 283


      I wanted to capture the 3rd and 4th entry in this line, I am able
      to do that using regular expressions like so:
      ^(?:S+s)2(S+) ([0-9]+)



      How do I translate this into a lisp regex ? so that elisp functions can
      understand. I couldn't use the above regex into re-builder within emacs. Says it is an invalid expression. What am I doing wrong ?










      share|improve this question
















      I have the following line :



      mod_name func_name /users/username/workspace/path_name/file.c 283


      I wanted to capture the 3rd and 4th entry in this line, I am able
      to do that using regular expressions like so:
      ^(?:S+s)2(S+) ([0-9]+)



      How do I translate this into a lisp regex ? so that elisp functions can
      understand. I couldn't use the above regex into re-builder within emacs. Says it is an invalid expression. What am I doing wrong ?







      regular-expressions






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited 5 hours ago









      Drew

      50.7k4 gold badges65 silver badges113 bronze badges




      50.7k4 gold badges65 silver badges113 bronze badges










      asked 10 hours ago









      maindoormaindoor

      204 bronze badges




      204 bronze badges























          1 Answer
          1






          active

          oldest

          votes


















          3














          Emacs regexps do not use S or s for non-whitespace and whitepsace. See (info "(elisp) Syntax of Regexps") for details. You can evaluate that which will jump to the corresponding info page.



          It's far easier and more readable to use the rx macro to create regexps in Emacs. Here is my translation to rx syntax of your example:



          (rx line-start
          (= 2 (and (one-or-more any) " "))
          (group (one-or-more any))
          " "
          (group (one-or-more digit)))


          And here is resulting regex string:



          "^\(?:.+ \)\2\\(.+\) \([0-9]+\)"


          Note that any which is expressed in regexps as "." does not match newlines in Emacs.






          share|improve this answer



























          • Thank you explaining rx macro.

            – maindoor
            5 hours ago











          • @Drew Thanks for editing!

            – clemera
            37 mins ago













          Your Answer








          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "583"
          ;
          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: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          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%2femacs.stackexchange.com%2fquestions%2f52114%2felisp-regular-expression-build-problem%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









          3














          Emacs regexps do not use S or s for non-whitespace and whitepsace. See (info "(elisp) Syntax of Regexps") for details. You can evaluate that which will jump to the corresponding info page.



          It's far easier and more readable to use the rx macro to create regexps in Emacs. Here is my translation to rx syntax of your example:



          (rx line-start
          (= 2 (and (one-or-more any) " "))
          (group (one-or-more any))
          " "
          (group (one-or-more digit)))


          And here is resulting regex string:



          "^\(?:.+ \)\2\\(.+\) \([0-9]+\)"


          Note that any which is expressed in regexps as "." does not match newlines in Emacs.






          share|improve this answer



























          • Thank you explaining rx macro.

            – maindoor
            5 hours ago











          • @Drew Thanks for editing!

            – clemera
            37 mins ago















          3














          Emacs regexps do not use S or s for non-whitespace and whitepsace. See (info "(elisp) Syntax of Regexps") for details. You can evaluate that which will jump to the corresponding info page.



          It's far easier and more readable to use the rx macro to create regexps in Emacs. Here is my translation to rx syntax of your example:



          (rx line-start
          (= 2 (and (one-or-more any) " "))
          (group (one-or-more any))
          " "
          (group (one-or-more digit)))


          And here is resulting regex string:



          "^\(?:.+ \)\2\\(.+\) \([0-9]+\)"


          Note that any which is expressed in regexps as "." does not match newlines in Emacs.






          share|improve this answer



























          • Thank you explaining rx macro.

            – maindoor
            5 hours ago











          • @Drew Thanks for editing!

            – clemera
            37 mins ago













          3












          3








          3







          Emacs regexps do not use S or s for non-whitespace and whitepsace. See (info "(elisp) Syntax of Regexps") for details. You can evaluate that which will jump to the corresponding info page.



          It's far easier and more readable to use the rx macro to create regexps in Emacs. Here is my translation to rx syntax of your example:



          (rx line-start
          (= 2 (and (one-or-more any) " "))
          (group (one-or-more any))
          " "
          (group (one-or-more digit)))


          And here is resulting regex string:



          "^\(?:.+ \)\2\\(.+\) \([0-9]+\)"


          Note that any which is expressed in regexps as "." does not match newlines in Emacs.






          share|improve this answer















          Emacs regexps do not use S or s for non-whitespace and whitepsace. See (info "(elisp) Syntax of Regexps") for details. You can evaluate that which will jump to the corresponding info page.



          It's far easier and more readable to use the rx macro to create regexps in Emacs. Here is my translation to rx syntax of your example:



          (rx line-start
          (= 2 (and (one-or-more any) " "))
          (group (one-or-more any))
          " "
          (group (one-or-more digit)))


          And here is resulting regex string:



          "^\(?:.+ \)\2\\(.+\) \([0-9]+\)"


          Note that any which is expressed in regexps as "." does not match newlines in Emacs.







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited 5 hours ago









          Drew

          50.7k4 gold badges65 silver badges113 bronze badges




          50.7k4 gold badges65 silver badges113 bronze badges










          answered 8 hours ago









          clemeraclemera

          2,1006 silver badges23 bronze badges




          2,1006 silver badges23 bronze badges















          • Thank you explaining rx macro.

            – maindoor
            5 hours ago











          • @Drew Thanks for editing!

            – clemera
            37 mins ago

















          • Thank you explaining rx macro.

            – maindoor
            5 hours ago











          • @Drew Thanks for editing!

            – clemera
            37 mins ago
















          Thank you explaining rx macro.

          – maindoor
          5 hours ago





          Thank you explaining rx macro.

          – maindoor
          5 hours ago













          @Drew Thanks for editing!

          – clemera
          37 mins ago





          @Drew Thanks for editing!

          – clemera
          37 mins ago

















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Emacs Stack Exchange!


          • 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%2femacs.stackexchange.com%2fquestions%2f52114%2felisp-regular-expression-build-problem%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

          ParseJSON using SSJSUsing AMPscript with SSJS ActivitiesHow to resubscribe a user in Marketing cloud using SSJS?Pulling Subscriber Status from Lists using SSJSRetrieving Emails using SSJSProblem in updating DE using SSJSUsing SSJS to send single email in Marketing CloudError adding EmailSendDefinition using SSJS

          Кампала Садржај Географија Географија Историја Становништво Привреда Партнерски градови Референце Спољашње везе Мени за навигацију0°11′ СГШ; 32°20′ ИГД / 0.18° СГШ; 32.34° ИГД / 0.18; 32.340°11′ СГШ; 32°20′ ИГД / 0.18° СГШ; 32.34° ИГД / 0.18; 32.34МедијиПодациЗванични веб-сајту

          19. јануар Садржај Догађаји Рођења Смрти Празници и дани сећања Види још Референце Мени за навигацијуу