Regex pattern to parse path with tabs and newlines?Regex Named Groups in JavaMatch all occurrences of a regexA comprehensive regex for phone number validationHow to negate specific word in regex?RegEx match open tags except XHTML self-contained tagsHow to parse JSON in JavaRegex Pattern to Match, Excluding when… / Except betweenregex multiline not working on repeated patternsRegex multiple capture groups on same patternRegex to identify a full path nameRegex matching lines with escaped new line character

Can the US President recognize Israel’s sovereignty over the Golan Heights for the USA or does that need an act of Congress?

Limits and Infinite Integration by Parts

Does IPv6 have similar concept of network mask?

How do apertures which seem too large to physically fit work?

Biological Blimps: Propulsion

Pre-mixing cryogenic fuels and using only one fuel tank

What should you do when eye contact makes your subordinate uncomfortable?

When were female captains banned from Starfleet?

What are the advantages of simplicial model categories over non-simplicial ones?

How much character growth crosses the line into breaking the character

Does malloc reserve more space while allocating memory?

Can I visit Japan without a visa?

Is this toilet slogan correct usage of the English language?

Plot of a tornado-shaped surface

How to explain what's wrong with this application of the chain rule?

Can a stoichiometric mixture of oxygen and methane exist as a liquid at standard pressure and some (low) temperature?

PTIJ: Haman's bad computer

Does the Linux kernel need a file system to run?

What is Cash Advance APR?

What if a revenant (monster) gains fire resistance?

Electoral considerations aside, what are potential benefits, for the US, of policy changes proposed by the tweet recognizing Golan annexation?

Fear of getting stuck on one programming language / technology that is not used in my country

The IT department bottlenecks progress. How should I handle this?

Why Shazam when there is already Superman?



Regex pattern to parse path with tabs and newlines?


Regex Named Groups in JavaMatch all occurrences of a regexA comprehensive regex for phone number validationHow to negate specific word in regex?RegEx match open tags except XHTML self-contained tagsHow to parse JSON in JavaRegex Pattern to Match, Excluding when… / Except betweenregex multiline not working on repeated patternsRegex multiple capture groups on same patternRegex to identify a full path nameRegex matching lines with escaped new line character













0















I've a path dirntsubdir1ntsubdir2nttfile.ext that I want to process one segment at a time. For each segment, I want to know how many tabs precede it, and I want to have the rest of the path intact. For the given example



Iteration 1:



Preceding tabs: 0
Segment: dir
Rest: ntsubdir1ntsubdir2nttfile.ext


Iteration 2:



Preceding tabs: 1
Segment: subdir1
Rest: ntsubdir2nttfile.ext


Iteration 3:



Preceding tabs: 1
Segment: subdir2
Rest: nttfile.ext


Iteration 4:



Preceding tabs: 2
Segment: file.ext
Rest: ""


The pattern I came up with is ((?<=\R)\h*)(\H+). However, that is giving me tsubdir1n as the first match. What am I doing wrong?










share|improve this question


























    0















    I've a path dirntsubdir1ntsubdir2nttfile.ext that I want to process one segment at a time. For each segment, I want to know how many tabs precede it, and I want to have the rest of the path intact. For the given example



    Iteration 1:



    Preceding tabs: 0
    Segment: dir
    Rest: ntsubdir1ntsubdir2nttfile.ext


    Iteration 2:



    Preceding tabs: 1
    Segment: subdir1
    Rest: ntsubdir2nttfile.ext


    Iteration 3:



    Preceding tabs: 1
    Segment: subdir2
    Rest: nttfile.ext


    Iteration 4:



    Preceding tabs: 2
    Segment: file.ext
    Rest: ""


    The pattern I came up with is ((?<=\R)\h*)(\H+). However, that is giving me tsubdir1n as the first match. What am I doing wrong?










    share|improve this question
























      0












      0








      0








      I've a path dirntsubdir1ntsubdir2nttfile.ext that I want to process one segment at a time. For each segment, I want to know how many tabs precede it, and I want to have the rest of the path intact. For the given example



      Iteration 1:



      Preceding tabs: 0
      Segment: dir
      Rest: ntsubdir1ntsubdir2nttfile.ext


      Iteration 2:



      Preceding tabs: 1
      Segment: subdir1
      Rest: ntsubdir2nttfile.ext


      Iteration 3:



      Preceding tabs: 1
      Segment: subdir2
      Rest: nttfile.ext


      Iteration 4:



      Preceding tabs: 2
      Segment: file.ext
      Rest: ""


      The pattern I came up with is ((?<=\R)\h*)(\H+). However, that is giving me tsubdir1n as the first match. What am I doing wrong?










      share|improve this question














      I've a path dirntsubdir1ntsubdir2nttfile.ext that I want to process one segment at a time. For each segment, I want to know how many tabs precede it, and I want to have the rest of the path intact. For the given example



      Iteration 1:



      Preceding tabs: 0
      Segment: dir
      Rest: ntsubdir1ntsubdir2nttfile.ext


      Iteration 2:



      Preceding tabs: 1
      Segment: subdir1
      Rest: ntsubdir2nttfile.ext


      Iteration 3:



      Preceding tabs: 1
      Segment: subdir2
      Rest: nttfile.ext


      Iteration 4:



      Preceding tabs: 2
      Segment: file.ext
      Rest: ""


      The pattern I came up with is ((?<=\R)\h*)(\H+). However, that is giving me tsubdir1n as the first match. What am I doing wrong?







      java regex regex-lookarounds regex-group






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Mar 8 at 2:17









      Abhijit SarkarAbhijit Sarkar

      7,72274395




      7,72274395






















          1 Answer
          1






          active

          oldest

          votes


















          1














          Since all sections are separated by line separator n you can simply use .+ to match them since by default dot . can't match line separators, so you are sure that it will stop before n (or any other line separator like r).



          You can also add some groups to separate tabs from actual segment like named group (?<tabs>t*) to match zero or more tabs at start of each match.



          To print rest of text after match simply substring after index of last matched character (you can obtain it via Matcher#end).



          To print string which will contain n and t (not as literals but as pair of backslash and letter) you can either manually replace each "n" with "\n" and "t" with "\t" or use utility class like StringEscapeUtils from org.apache.commons.lang which contains escapeJava method which does it for us.



          So your code can look like:



          String path = "dirntsubdir1ntsubdir2nttfile.ext";
          Pattern p = Pattern.compile("(?<tabs>t*)(?<segment>.+)");//dot can't match line separators
          Matcher m = p.matcher(path);
          int i = 1;
          while(m.find())
          System.out.println("iteration: " + i++);
          System.out.println("Preceding tabs: " + (m.group("tabs").length()));
          System.out.println("Segment: " + m.group("segment"));
          System.out.println("Rest: "+ StringEscapeUtils.escapeJava(path.substring(m.end())));
          System.out.println();



          Output:



          iteration: 1
          Preceding tabs: 0
          Segment: dir
          Rest: ntsubdir1ntsubdir2nttfile.ext

          iteration: 2
          Preceding tabs: 1
          Segment: subdir1
          Rest: ntsubdir2nttfile.ext

          iteration: 3
          Preceding tabs: 1
          Segment: subdir2
          Rest: nttfile.ext

          iteration: 4
          Preceding tabs: 2
          Segment: file.ext
          Rest:





          share|improve this answer

























          • Couple of comments: 1) StringEscapeUtils is now in commons-text, the one in commons-lang has been deprecated. 2) To literally print n, replace with \\n, not \n.

            – Abhijit Sarkar
            Mar 9 at 6:42







          • 1





            @AbhijitSarkar (1) thanks for update, (2) only if you are using replaceAll which supports regex where is metacharecter and require additional escaping. But if you use replace which doesn't support regex syntax and also replaces all matches replace("n", "\n") should work fine.

            – Pshemo
            Mar 9 at 10:28











          • You're correct, about replace. Can it be any more confusing, that both replace and replaceAll actually replace all?

            – Abhijit Sarkar
            Mar 9 at 20:42











          • @AbhijitSarkar Yes, naming of replacing methods is confusing. Probable rationale behind All suffix is that it emphasize difference between it and replaceFrist which also supports regex syntax. Confusing part is that other replacing methods: replace(char target, char replacement) and replace(CharSequence target, CharSequence replacement) don't use regex but also replace all occurrences of target.

            – Pshemo
            Mar 9 at 22:24












          • Alternative names could be replaceRegex and replaceFirstRegex which IMO would be less confusing but some could say that these names could be too long (which IMO is not the case since IDE would suggest them and people would autocomplete them, so we wouldn't really need more keystrokes). But that is just my opinion.

            – Pshemo
            Mar 9 at 22:29











          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%2f55055788%2fregex-pattern-to-parse-path-with-tabs-and-newlines%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









          1














          Since all sections are separated by line separator n you can simply use .+ to match them since by default dot . can't match line separators, so you are sure that it will stop before n (or any other line separator like r).



          You can also add some groups to separate tabs from actual segment like named group (?<tabs>t*) to match zero or more tabs at start of each match.



          To print rest of text after match simply substring after index of last matched character (you can obtain it via Matcher#end).



          To print string which will contain n and t (not as literals but as pair of backslash and letter) you can either manually replace each "n" with "\n" and "t" with "\t" or use utility class like StringEscapeUtils from org.apache.commons.lang which contains escapeJava method which does it for us.



          So your code can look like:



          String path = "dirntsubdir1ntsubdir2nttfile.ext";
          Pattern p = Pattern.compile("(?<tabs>t*)(?<segment>.+)");//dot can't match line separators
          Matcher m = p.matcher(path);
          int i = 1;
          while(m.find())
          System.out.println("iteration: " + i++);
          System.out.println("Preceding tabs: " + (m.group("tabs").length()));
          System.out.println("Segment: " + m.group("segment"));
          System.out.println("Rest: "+ StringEscapeUtils.escapeJava(path.substring(m.end())));
          System.out.println();



          Output:



          iteration: 1
          Preceding tabs: 0
          Segment: dir
          Rest: ntsubdir1ntsubdir2nttfile.ext

          iteration: 2
          Preceding tabs: 1
          Segment: subdir1
          Rest: ntsubdir2nttfile.ext

          iteration: 3
          Preceding tabs: 1
          Segment: subdir2
          Rest: nttfile.ext

          iteration: 4
          Preceding tabs: 2
          Segment: file.ext
          Rest:





          share|improve this answer

























          • Couple of comments: 1) StringEscapeUtils is now in commons-text, the one in commons-lang has been deprecated. 2) To literally print n, replace with \\n, not \n.

            – Abhijit Sarkar
            Mar 9 at 6:42







          • 1





            @AbhijitSarkar (1) thanks for update, (2) only if you are using replaceAll which supports regex where is metacharecter and require additional escaping. But if you use replace which doesn't support regex syntax and also replaces all matches replace("n", "\n") should work fine.

            – Pshemo
            Mar 9 at 10:28











          • You're correct, about replace. Can it be any more confusing, that both replace and replaceAll actually replace all?

            – Abhijit Sarkar
            Mar 9 at 20:42











          • @AbhijitSarkar Yes, naming of replacing methods is confusing. Probable rationale behind All suffix is that it emphasize difference between it and replaceFrist which also supports regex syntax. Confusing part is that other replacing methods: replace(char target, char replacement) and replace(CharSequence target, CharSequence replacement) don't use regex but also replace all occurrences of target.

            – Pshemo
            Mar 9 at 22:24












          • Alternative names could be replaceRegex and replaceFirstRegex which IMO would be less confusing but some could say that these names could be too long (which IMO is not the case since IDE would suggest them and people would autocomplete them, so we wouldn't really need more keystrokes). But that is just my opinion.

            – Pshemo
            Mar 9 at 22:29
















          1














          Since all sections are separated by line separator n you can simply use .+ to match them since by default dot . can't match line separators, so you are sure that it will stop before n (or any other line separator like r).



          You can also add some groups to separate tabs from actual segment like named group (?<tabs>t*) to match zero or more tabs at start of each match.



          To print rest of text after match simply substring after index of last matched character (you can obtain it via Matcher#end).



          To print string which will contain n and t (not as literals but as pair of backslash and letter) you can either manually replace each "n" with "\n" and "t" with "\t" or use utility class like StringEscapeUtils from org.apache.commons.lang which contains escapeJava method which does it for us.



          So your code can look like:



          String path = "dirntsubdir1ntsubdir2nttfile.ext";
          Pattern p = Pattern.compile("(?<tabs>t*)(?<segment>.+)");//dot can't match line separators
          Matcher m = p.matcher(path);
          int i = 1;
          while(m.find())
          System.out.println("iteration: " + i++);
          System.out.println("Preceding tabs: " + (m.group("tabs").length()));
          System.out.println("Segment: " + m.group("segment"));
          System.out.println("Rest: "+ StringEscapeUtils.escapeJava(path.substring(m.end())));
          System.out.println();



          Output:



          iteration: 1
          Preceding tabs: 0
          Segment: dir
          Rest: ntsubdir1ntsubdir2nttfile.ext

          iteration: 2
          Preceding tabs: 1
          Segment: subdir1
          Rest: ntsubdir2nttfile.ext

          iteration: 3
          Preceding tabs: 1
          Segment: subdir2
          Rest: nttfile.ext

          iteration: 4
          Preceding tabs: 2
          Segment: file.ext
          Rest:





          share|improve this answer

























          • Couple of comments: 1) StringEscapeUtils is now in commons-text, the one in commons-lang has been deprecated. 2) To literally print n, replace with \\n, not \n.

            – Abhijit Sarkar
            Mar 9 at 6:42







          • 1





            @AbhijitSarkar (1) thanks for update, (2) only if you are using replaceAll which supports regex where is metacharecter and require additional escaping. But if you use replace which doesn't support regex syntax and also replaces all matches replace("n", "\n") should work fine.

            – Pshemo
            Mar 9 at 10:28











          • You're correct, about replace. Can it be any more confusing, that both replace and replaceAll actually replace all?

            – Abhijit Sarkar
            Mar 9 at 20:42











          • @AbhijitSarkar Yes, naming of replacing methods is confusing. Probable rationale behind All suffix is that it emphasize difference between it and replaceFrist which also supports regex syntax. Confusing part is that other replacing methods: replace(char target, char replacement) and replace(CharSequence target, CharSequence replacement) don't use regex but also replace all occurrences of target.

            – Pshemo
            Mar 9 at 22:24












          • Alternative names could be replaceRegex and replaceFirstRegex which IMO would be less confusing but some could say that these names could be too long (which IMO is not the case since IDE would suggest them and people would autocomplete them, so we wouldn't really need more keystrokes). But that is just my opinion.

            – Pshemo
            Mar 9 at 22:29














          1












          1








          1







          Since all sections are separated by line separator n you can simply use .+ to match them since by default dot . can't match line separators, so you are sure that it will stop before n (or any other line separator like r).



          You can also add some groups to separate tabs from actual segment like named group (?<tabs>t*) to match zero or more tabs at start of each match.



          To print rest of text after match simply substring after index of last matched character (you can obtain it via Matcher#end).



          To print string which will contain n and t (not as literals but as pair of backslash and letter) you can either manually replace each "n" with "\n" and "t" with "\t" or use utility class like StringEscapeUtils from org.apache.commons.lang which contains escapeJava method which does it for us.



          So your code can look like:



          String path = "dirntsubdir1ntsubdir2nttfile.ext";
          Pattern p = Pattern.compile("(?<tabs>t*)(?<segment>.+)");//dot can't match line separators
          Matcher m = p.matcher(path);
          int i = 1;
          while(m.find())
          System.out.println("iteration: " + i++);
          System.out.println("Preceding tabs: " + (m.group("tabs").length()));
          System.out.println("Segment: " + m.group("segment"));
          System.out.println("Rest: "+ StringEscapeUtils.escapeJava(path.substring(m.end())));
          System.out.println();



          Output:



          iteration: 1
          Preceding tabs: 0
          Segment: dir
          Rest: ntsubdir1ntsubdir2nttfile.ext

          iteration: 2
          Preceding tabs: 1
          Segment: subdir1
          Rest: ntsubdir2nttfile.ext

          iteration: 3
          Preceding tabs: 1
          Segment: subdir2
          Rest: nttfile.ext

          iteration: 4
          Preceding tabs: 2
          Segment: file.ext
          Rest:





          share|improve this answer















          Since all sections are separated by line separator n you can simply use .+ to match them since by default dot . can't match line separators, so you are sure that it will stop before n (or any other line separator like r).



          You can also add some groups to separate tabs from actual segment like named group (?<tabs>t*) to match zero or more tabs at start of each match.



          To print rest of text after match simply substring after index of last matched character (you can obtain it via Matcher#end).



          To print string which will contain n and t (not as literals but as pair of backslash and letter) you can either manually replace each "n" with "\n" and "t" with "\t" or use utility class like StringEscapeUtils from org.apache.commons.lang which contains escapeJava method which does it for us.



          So your code can look like:



          String path = "dirntsubdir1ntsubdir2nttfile.ext";
          Pattern p = Pattern.compile("(?<tabs>t*)(?<segment>.+)");//dot can't match line separators
          Matcher m = p.matcher(path);
          int i = 1;
          while(m.find())
          System.out.println("iteration: " + i++);
          System.out.println("Preceding tabs: " + (m.group("tabs").length()));
          System.out.println("Segment: " + m.group("segment"));
          System.out.println("Rest: "+ StringEscapeUtils.escapeJava(path.substring(m.end())));
          System.out.println();



          Output:



          iteration: 1
          Preceding tabs: 0
          Segment: dir
          Rest: ntsubdir1ntsubdir2nttfile.ext

          iteration: 2
          Preceding tabs: 1
          Segment: subdir1
          Rest: ntsubdir2nttfile.ext

          iteration: 3
          Preceding tabs: 1
          Segment: subdir2
          Rest: nttfile.ext

          iteration: 4
          Preceding tabs: 2
          Segment: file.ext
          Rest:






          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Mar 8 at 14:03

























          answered Mar 8 at 2:49









          PshemoPshemo

          95.8k15133193




          95.8k15133193












          • Couple of comments: 1) StringEscapeUtils is now in commons-text, the one in commons-lang has been deprecated. 2) To literally print n, replace with \\n, not \n.

            – Abhijit Sarkar
            Mar 9 at 6:42







          • 1





            @AbhijitSarkar (1) thanks for update, (2) only if you are using replaceAll which supports regex where is metacharecter and require additional escaping. But if you use replace which doesn't support regex syntax and also replaces all matches replace("n", "\n") should work fine.

            – Pshemo
            Mar 9 at 10:28











          • You're correct, about replace. Can it be any more confusing, that both replace and replaceAll actually replace all?

            – Abhijit Sarkar
            Mar 9 at 20:42











          • @AbhijitSarkar Yes, naming of replacing methods is confusing. Probable rationale behind All suffix is that it emphasize difference between it and replaceFrist which also supports regex syntax. Confusing part is that other replacing methods: replace(char target, char replacement) and replace(CharSequence target, CharSequence replacement) don't use regex but also replace all occurrences of target.

            – Pshemo
            Mar 9 at 22:24












          • Alternative names could be replaceRegex and replaceFirstRegex which IMO would be less confusing but some could say that these names could be too long (which IMO is not the case since IDE would suggest them and people would autocomplete them, so we wouldn't really need more keystrokes). But that is just my opinion.

            – Pshemo
            Mar 9 at 22:29


















          • Couple of comments: 1) StringEscapeUtils is now in commons-text, the one in commons-lang has been deprecated. 2) To literally print n, replace with \\n, not \n.

            – Abhijit Sarkar
            Mar 9 at 6:42







          • 1





            @AbhijitSarkar (1) thanks for update, (2) only if you are using replaceAll which supports regex where is metacharecter and require additional escaping. But if you use replace which doesn't support regex syntax and also replaces all matches replace("n", "\n") should work fine.

            – Pshemo
            Mar 9 at 10:28











          • You're correct, about replace. Can it be any more confusing, that both replace and replaceAll actually replace all?

            – Abhijit Sarkar
            Mar 9 at 20:42











          • @AbhijitSarkar Yes, naming of replacing methods is confusing. Probable rationale behind All suffix is that it emphasize difference between it and replaceFrist which also supports regex syntax. Confusing part is that other replacing methods: replace(char target, char replacement) and replace(CharSequence target, CharSequence replacement) don't use regex but also replace all occurrences of target.

            – Pshemo
            Mar 9 at 22:24












          • Alternative names could be replaceRegex and replaceFirstRegex which IMO would be less confusing but some could say that these names could be too long (which IMO is not the case since IDE would suggest them and people would autocomplete them, so we wouldn't really need more keystrokes). But that is just my opinion.

            – Pshemo
            Mar 9 at 22:29

















          Couple of comments: 1) StringEscapeUtils is now in commons-text, the one in commons-lang has been deprecated. 2) To literally print n, replace with \\n, not \n.

          – Abhijit Sarkar
          Mar 9 at 6:42






          Couple of comments: 1) StringEscapeUtils is now in commons-text, the one in commons-lang has been deprecated. 2) To literally print n, replace with \\n, not \n.

          – Abhijit Sarkar
          Mar 9 at 6:42





          1




          1





          @AbhijitSarkar (1) thanks for update, (2) only if you are using replaceAll which supports regex where is metacharecter and require additional escaping. But if you use replace which doesn't support regex syntax and also replaces all matches replace("n", "\n") should work fine.

          – Pshemo
          Mar 9 at 10:28





          @AbhijitSarkar (1) thanks for update, (2) only if you are using replaceAll which supports regex where is metacharecter and require additional escaping. But if you use replace which doesn't support regex syntax and also replaces all matches replace("n", "\n") should work fine.

          – Pshemo
          Mar 9 at 10:28













          You're correct, about replace. Can it be any more confusing, that both replace and replaceAll actually replace all?

          – Abhijit Sarkar
          Mar 9 at 20:42





          You're correct, about replace. Can it be any more confusing, that both replace and replaceAll actually replace all?

          – Abhijit Sarkar
          Mar 9 at 20:42













          @AbhijitSarkar Yes, naming of replacing methods is confusing. Probable rationale behind All suffix is that it emphasize difference between it and replaceFrist which also supports regex syntax. Confusing part is that other replacing methods: replace(char target, char replacement) and replace(CharSequence target, CharSequence replacement) don't use regex but also replace all occurrences of target.

          – Pshemo
          Mar 9 at 22:24






          @AbhijitSarkar Yes, naming of replacing methods is confusing. Probable rationale behind All suffix is that it emphasize difference between it and replaceFrist which also supports regex syntax. Confusing part is that other replacing methods: replace(char target, char replacement) and replace(CharSequence target, CharSequence replacement) don't use regex but also replace all occurrences of target.

          – Pshemo
          Mar 9 at 22:24














          Alternative names could be replaceRegex and replaceFirstRegex which IMO would be less confusing but some could say that these names could be too long (which IMO is not the case since IDE would suggest them and people would autocomplete them, so we wouldn't really need more keystrokes). But that is just my opinion.

          – Pshemo
          Mar 9 at 22:29






          Alternative names could be replaceRegex and replaceFirstRegex which IMO would be less confusing but some could say that these names could be too long (which IMO is not the case since IDE would suggest them and people would autocomplete them, so we wouldn't really need more keystrokes). But that is just my opinion.

          – Pshemo
          Mar 9 at 22:29




















          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%2f55055788%2fregex-pattern-to-parse-path-with-tabs-and-newlines%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

          Identity Server 4 is not redirecting to Angular app after login2019 Community Moderator ElectionIdentity Server 4 and dockerIdentityserver implicit flow unauthorized_clientIdentityServer Hybrid Flow - Access Token is null after user successful loginIdentity Server to MVC client : Page Redirect After loginLogin with Steam OpenId(oidc-client-js)Identity Server 4+.NET Core 2.0 + IdentityIdentityServer4 post-login redirect not working in Edge browserCall to IdentityServer4 generates System.NullReferenceException: Object reference not set to an instance of an objectIdentityServer4 without HTTPS not workingHow to get Authorization code from identity server without login form

          2005 Ahvaz unrest Contents Background Causes Casualties Aftermath See also References Navigation menue"At Least 10 Are Killed by Bombs in Iran""Iran"Archived"Arab-Iranians in Iran to make April 15 'Day of Fury'"State of Mind, State of Order: Reactions to Ethnic Unrest in the Islamic Republic of Iran.10.1111/j.1754-9469.2008.00028.x"Iran hangs Arab separatists"Iran Overview from ArchivedConstitution of the Islamic Republic of Iran"Tehran puzzled by forged 'riots' letter""Iran and its minorities: Down in the second class""Iran: Handling Of Ahvaz Unrest Could End With Televised Confessions""Bombings Rock Iran Ahead of Election""Five die in Iran ethnic clashes""Iran: Need for restraint as anniversary of unrest in Khuzestan approaches"Archived"Iranian Sunni protesters killed in clashes with security forces"Archived

          Can't initialize raids on a new ASUS Prime B360M-A motherboard2019 Community Moderator ElectionSimilar to RAID config yet more like mirroring solution?Can't get motherboard serial numberWhy does the BIOS entry point start with a WBINVD instruction?UEFI performance Asus Maximus V Extreme