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
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
add a comment |
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
add a comment |
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
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
java regex regex-lookarounds regex-group
asked Mar 8 at 2:17
Abhijit SarkarAbhijit Sarkar
7,72274395
7,72274395
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
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:
Couple of comments: 1)StringEscapeUtils
is now in commons-text, the one in commons-lang has been deprecated. 2) To literally printn
, replace with\\n
, not\n
.
– Abhijit Sarkar
Mar 9 at 6:42
1
@AbhijitSarkar (1) thanks for update, (2) only if you are usingreplaceAll
which supports regex where is metacharecter and require additional escaping. But if you usereplace
which doesn't support regex syntax and also replaces all matchesreplace("n", "\n")
should work fine.
– Pshemo
Mar 9 at 10:28
You're correct, aboutreplace
. Can it be any more confusing, that bothreplace
andreplaceAll
actually replace all?
– Abhijit Sarkar
Mar 9 at 20:42
@AbhijitSarkar Yes, naming of replacing methods is confusing. Probable rationale behindAll
suffix is that it emphasize difference between it andreplaceFrist
which also supports regex syntax. Confusing part is that other replacing methods:replace(char target, char replacement)
andreplace(CharSequence target, CharSequence replacement)
don't use regex but also replace all occurrences oftarget
.
– Pshemo
Mar 9 at 22:24
Alternative names could bereplaceRegex
andreplaceFirstRegex
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
|
show 3 more comments
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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:
Couple of comments: 1)StringEscapeUtils
is now in commons-text, the one in commons-lang has been deprecated. 2) To literally printn
, replace with\\n
, not\n
.
– Abhijit Sarkar
Mar 9 at 6:42
1
@AbhijitSarkar (1) thanks for update, (2) only if you are usingreplaceAll
which supports regex where is metacharecter and require additional escaping. But if you usereplace
which doesn't support regex syntax and also replaces all matchesreplace("n", "\n")
should work fine.
– Pshemo
Mar 9 at 10:28
You're correct, aboutreplace
. Can it be any more confusing, that bothreplace
andreplaceAll
actually replace all?
– Abhijit Sarkar
Mar 9 at 20:42
@AbhijitSarkar Yes, naming of replacing methods is confusing. Probable rationale behindAll
suffix is that it emphasize difference between it andreplaceFrist
which also supports regex syntax. Confusing part is that other replacing methods:replace(char target, char replacement)
andreplace(CharSequence target, CharSequence replacement)
don't use regex but also replace all occurrences oftarget
.
– Pshemo
Mar 9 at 22:24
Alternative names could bereplaceRegex
andreplaceFirstRegex
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
|
show 3 more comments
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:
Couple of comments: 1)StringEscapeUtils
is now in commons-text, the one in commons-lang has been deprecated. 2) To literally printn
, replace with\\n
, not\n
.
– Abhijit Sarkar
Mar 9 at 6:42
1
@AbhijitSarkar (1) thanks for update, (2) only if you are usingreplaceAll
which supports regex where is metacharecter and require additional escaping. But if you usereplace
which doesn't support regex syntax and also replaces all matchesreplace("n", "\n")
should work fine.
– Pshemo
Mar 9 at 10:28
You're correct, aboutreplace
. Can it be any more confusing, that bothreplace
andreplaceAll
actually replace all?
– Abhijit Sarkar
Mar 9 at 20:42
@AbhijitSarkar Yes, naming of replacing methods is confusing. Probable rationale behindAll
suffix is that it emphasize difference between it andreplaceFrist
which also supports regex syntax. Confusing part is that other replacing methods:replace(char target, char replacement)
andreplace(CharSequence target, CharSequence replacement)
don't use regex but also replace all occurrences oftarget
.
– Pshemo
Mar 9 at 22:24
Alternative names could bereplaceRegex
andreplaceFirstRegex
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
|
show 3 more comments
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:
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:
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 printn
, replace with\\n
, not\n
.
– Abhijit Sarkar
Mar 9 at 6:42
1
@AbhijitSarkar (1) thanks for update, (2) only if you are usingreplaceAll
which supports regex where is metacharecter and require additional escaping. But if you usereplace
which doesn't support regex syntax and also replaces all matchesreplace("n", "\n")
should work fine.
– Pshemo
Mar 9 at 10:28
You're correct, aboutreplace
. Can it be any more confusing, that bothreplace
andreplaceAll
actually replace all?
– Abhijit Sarkar
Mar 9 at 20:42
@AbhijitSarkar Yes, naming of replacing methods is confusing. Probable rationale behindAll
suffix is that it emphasize difference between it andreplaceFrist
which also supports regex syntax. Confusing part is that other replacing methods:replace(char target, char replacement)
andreplace(CharSequence target, CharSequence replacement)
don't use regex but also replace all occurrences oftarget
.
– Pshemo
Mar 9 at 22:24
Alternative names could bereplaceRegex
andreplaceFirstRegex
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
|
show 3 more comments
Couple of comments: 1)StringEscapeUtils
is now in commons-text, the one in commons-lang has been deprecated. 2) To literally printn
, replace with\\n
, not\n
.
– Abhijit Sarkar
Mar 9 at 6:42
1
@AbhijitSarkar (1) thanks for update, (2) only if you are usingreplaceAll
which supports regex where is metacharecter and require additional escaping. But if you usereplace
which doesn't support regex syntax and also replaces all matchesreplace("n", "\n")
should work fine.
– Pshemo
Mar 9 at 10:28
You're correct, aboutreplace
. Can it be any more confusing, that bothreplace
andreplaceAll
actually replace all?
– Abhijit Sarkar
Mar 9 at 20:42
@AbhijitSarkar Yes, naming of replacing methods is confusing. Probable rationale behindAll
suffix is that it emphasize difference between it andreplaceFrist
which also supports regex syntax. Confusing part is that other replacing methods:replace(char target, char replacement)
andreplace(CharSequence target, CharSequence replacement)
don't use regex but also replace all occurrences oftarget
.
– Pshemo
Mar 9 at 22:24
Alternative names could bereplaceRegex
andreplaceFirstRegex
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
|
show 3 more comments
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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