C#. Split string with separator by regex if separator is surrounded by something The Next CEO of Stack OverflowWhat is the difference between String and string in C#?Convert a string to an enum in C#Catch multiple exceptions at once?How do you convert a byte array to a hexadecimal string, and vice versa?How do you access the matched groups in a JavaScript regular expression?How do I get a consistent byte representation of strings in C# without manually specifying an encoding?Creating a comma separated list from IList<string> or IEnumerable<string>Get property value from string using reflection in C#C# Split A String By Another StringCheck whether a string matches a regex in JS

Text adventure game code

What can we do to stop prior company from asking us questions?

If I blow insulation everywhere in my attic except the door trap, will heat escape through it?

Anatomically Correct Mesopelagic Aves

How long to clear the 'suck zone' of a turbofan after start is initiated?

WOW air has ceased operation, can I get my tickets refunded?

How easy is it to start Magic from scratch?

Are there languages with no euphemisms?

When did Lisp start using symbols for arithmetic?

Why here is plural "We went to the movies last night."

Can a caster that cast Polymorph on themselves stop concentrating at any point even if their Int is low?

Return of the Riley Riddles in Reverse

How do we know the LHC results are robust?

Inappropriate reference requests from Journal reviewers

Unreliable Magic - Is it worth it?

How to Reset Passwords on Multiple Websites Easily?

How to write papers efficiently when English isn't my first language?

Science fiction (dystopian) short story set after WWIII

Can the Reverse Gravity spell affect the Meteor Swarm spell?

Why did we only see the N-1 starfighters in one film?

What does this shorthand mean?

Removing read access from a file

What do "high sea" and "carry" mean in this sentence?

What is the point of a new vote on May's deal when the indicative votes suggest she will not win?



C#. Split string with separator by regex if separator is surrounded by something



The Next CEO of Stack OverflowWhat is the difference between String and string in C#?Convert a string to an enum in C#Catch multiple exceptions at once?How do you convert a byte array to a hexadecimal string, and vice versa?How do you access the matched groups in a JavaScript regular expression?How do I get a consistent byte representation of strings in C# without manually specifying an encoding?Creating a comma separated list from IList<string> or IEnumerable<string>Get property value from string using reflection in C#C# Split A String By Another StringCheck whether a string matches a regex in JS










-3















Given string "Hello.World"
I want to get an array [ "Hello.World" ]



Given string "Hello.World"
I want to get an array [ "Hello", "World" ]










share|improve this question

















  • 2





    What do you want returned for "Hello\.World"?

    – Dour High Arch
    Mar 21 at 16:29






  • 1





    (?<!\).?

    – Ahmed Abdelhameed
    Mar 21 at 16:30






  • 1





    You want a "negative lookbehind"

    – Blorgbeard
    Mar 21 at 16:30











  • @DourHighArch the first case. I skipped @ to make it more readable. Sorry for non-obviousness

    – Herrgott
    Mar 21 at 16:35















-3















Given string "Hello.World"
I want to get an array [ "Hello.World" ]



Given string "Hello.World"
I want to get an array [ "Hello", "World" ]










share|improve this question

















  • 2





    What do you want returned for "Hello\.World"?

    – Dour High Arch
    Mar 21 at 16:29






  • 1





    (?<!\).?

    – Ahmed Abdelhameed
    Mar 21 at 16:30






  • 1





    You want a "negative lookbehind"

    – Blorgbeard
    Mar 21 at 16:30











  • @DourHighArch the first case. I skipped @ to make it more readable. Sorry for non-obviousness

    – Herrgott
    Mar 21 at 16:35













-3












-3








-3








Given string "Hello.World"
I want to get an array [ "Hello.World" ]



Given string "Hello.World"
I want to get an array [ "Hello", "World" ]










share|improve this question














Given string "Hello.World"
I want to get an array [ "Hello.World" ]



Given string "Hello.World"
I want to get an array [ "Hello", "World" ]







c# regex






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Mar 21 at 16:26









HerrgottHerrgott

210521




210521







  • 2





    What do you want returned for "Hello\.World"?

    – Dour High Arch
    Mar 21 at 16:29






  • 1





    (?<!\).?

    – Ahmed Abdelhameed
    Mar 21 at 16:30






  • 1





    You want a "negative lookbehind"

    – Blorgbeard
    Mar 21 at 16:30











  • @DourHighArch the first case. I skipped @ to make it more readable. Sorry for non-obviousness

    – Herrgott
    Mar 21 at 16:35












  • 2





    What do you want returned for "Hello\.World"?

    – Dour High Arch
    Mar 21 at 16:29






  • 1





    (?<!\).?

    – Ahmed Abdelhameed
    Mar 21 at 16:30






  • 1





    You want a "negative lookbehind"

    – Blorgbeard
    Mar 21 at 16:30











  • @DourHighArch the first case. I skipped @ to make it more readable. Sorry for non-obviousness

    – Herrgott
    Mar 21 at 16:35







2




2





What do you want returned for "Hello\.World"?

– Dour High Arch
Mar 21 at 16:29





What do you want returned for "Hello\.World"?

– Dour High Arch
Mar 21 at 16:29




1




1





(?<!\).?

– Ahmed Abdelhameed
Mar 21 at 16:30





(?<!\).?

– Ahmed Abdelhameed
Mar 21 at 16:30




1




1





You want a "negative lookbehind"

– Blorgbeard
Mar 21 at 16:30





You want a "negative lookbehind"

– Blorgbeard
Mar 21 at 16:30













@DourHighArch the first case. I skipped @ to make it more readable. Sorry for non-obviousness

– Herrgott
Mar 21 at 16:35





@DourHighArch the first case. I skipped @ to make it more readable. Sorry for non-obviousness

– Herrgott
Mar 21 at 16:35












1 Answer
1






active

oldest

votes


















2














You can use a negative lookbehind using Regex.Split()... something like:



Regex.Split(input, @"(?<!\).");


Sample fiddle






share|improve this answer




















  • 1





    Life gets harder, of course, if you want to be able to escape the escapes...

    – canton7
    Mar 21 at 16:36






  • 1





    @canton7 I don't need to escape escapes. This answer fits my needs

    – Herrgott
    Mar 21 at 16:38












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%2f55285050%2fc-split-string-with-separator-by-regex-if-separator-is-surrounded-by-something%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









2














You can use a negative lookbehind using Regex.Split()... something like:



Regex.Split(input, @"(?<!\).");


Sample fiddle






share|improve this answer




















  • 1





    Life gets harder, of course, if you want to be able to escape the escapes...

    – canton7
    Mar 21 at 16:36






  • 1





    @canton7 I don't need to escape escapes. This answer fits my needs

    – Herrgott
    Mar 21 at 16:38
















2














You can use a negative lookbehind using Regex.Split()... something like:



Regex.Split(input, @"(?<!\).");


Sample fiddle






share|improve this answer




















  • 1





    Life gets harder, of course, if you want to be able to escape the escapes...

    – canton7
    Mar 21 at 16:36






  • 1





    @canton7 I don't need to escape escapes. This answer fits my needs

    – Herrgott
    Mar 21 at 16:38














2












2








2







You can use a negative lookbehind using Regex.Split()... something like:



Regex.Split(input, @"(?<!\).");


Sample fiddle






share|improve this answer















You can use a negative lookbehind using Regex.Split()... something like:



Regex.Split(input, @"(?<!\).");


Sample fiddle







share|improve this answer














share|improve this answer



share|improve this answer








edited Mar 21 at 16:36

























answered Mar 21 at 16:35









JclJcl

20.6k24266




20.6k24266







  • 1





    Life gets harder, of course, if you want to be able to escape the escapes...

    – canton7
    Mar 21 at 16:36






  • 1





    @canton7 I don't need to escape escapes. This answer fits my needs

    – Herrgott
    Mar 21 at 16:38













  • 1





    Life gets harder, of course, if you want to be able to escape the escapes...

    – canton7
    Mar 21 at 16:36






  • 1





    @canton7 I don't need to escape escapes. This answer fits my needs

    – Herrgott
    Mar 21 at 16:38








1




1





Life gets harder, of course, if you want to be able to escape the escapes...

– canton7
Mar 21 at 16:36





Life gets harder, of course, if you want to be able to escape the escapes...

– canton7
Mar 21 at 16:36




1




1





@canton7 I don't need to escape escapes. This answer fits my needs

– Herrgott
Mar 21 at 16:38






@canton7 I don't need to escape escapes. This answer fits my needs

– Herrgott
Mar 21 at 16:38




















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%2f55285050%2fc-split-string-with-separator-by-regex-if-separator-is-surrounded-by-something%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권, 지리지 충청도 공주목 은진현