Click here to Skip to main content
14,459,361 members
   

C#

 
QuestionRegExReplace \K (discard what has been matched so far) workaround / Alternative Pin
Lupu5R3x24-Jan-20 3:31
MemberLupu5R3x24-Jan-20 3:31 
AnswerRe: RegExReplace \K (discard what has been matched so far) workaround / Alternative Pin
Pete O'Hanlon24-Jan-20 4:38
communityengineerPete O'Hanlon24-Jan-20 4:38 
GeneralRe: RegExReplace \K (discard what has been matched so far) workaround / Alternative Pin
Lupu5R3x24-Jan-20 5:03
MemberLupu5R3x24-Jan-20 5:03 
AnswerRe: RegExReplace \K (discard what has been matched so far) workaround / Alternative Pin
Gerry Schmitz24-Jan-20 6:00
mveGerry Schmitz24-Jan-20 6:00 
GeneralRe: RegExReplace \K (discard what has been matched so far) workaround / Alternative Pin
Lupu5R3x24-Jan-20 7:11
MemberLupu5R3x24-Jan-20 7:11 
GeneralRe: RegExReplace \K (discard what has been matched so far) workaround / Alternative Pin
Gerry Schmitz24-Jan-20 8:20
mveGerry Schmitz24-Jan-20 8:20 
GeneralRe: RegExReplace \K (discard what has been matched so far) workaround / Alternative Pin
Lupu5R3x24-Jan-20 9:01
MemberLupu5R3x24-Jan-20 9:01 
AnswerRe: RegExReplace \K (discard what has been matched so far) workaround / Alternative Pin
Lupu5R3x24-Jan-20 8:47
MemberLupu5R3x24-Jan-20 8:47 
Hmm
So I came up with this
string splittSet = "";
            string test_pattern = @"(.{1,60})(\s{1,2}|$)";
            RegexOptions regexOptions = RegexOptions.None;
            Regex splitText = new Regex(test_pattern, regexOptions);
            string inputData = @"The wolf is thought to be an ice age survivor, dating wolves around 300,000 years ago. The wolf is accepted to be the ancestor of the domestic dog as the wolf is thought to have selectively bred in order to breed appealing traits typical of puppies and to eliminate the not so appealing traits of adult wolves.";
            foreach (Match match in splitText.Matches(inputData))
            {
                if (match.Success)
                {
                    splittSet += match.Groups[0].Value + "\n\r";
                }
            }

Definitely not not as elegant as my original regex, but it seems to work :/ though I do hope that someone have a better/more elegant way of doing it Smile | :)

/LR
GeneralRe: RegExReplace \K (discard what has been matched so far) workaround / Alternative Pin
Gerry Schmitz24-Jan-20 9:09
mveGerry Schmitz24-Jan-20 9:09 
GeneralRe: RegExReplace \K (discard what has been matched so far) workaround / Alternative Pin
Lupu5R3x24-Jan-20 9:21
MemberLupu5R3x24-Jan-20 9:21 
GeneralRe: RegExReplace \K (discard what has been matched so far) workaround / Alternative Pin
Gerry Schmitz24-Jan-20 9:39
mveGerry Schmitz24-Jan-20 9:39 
GeneralRe: RegExReplace \K (discard what has been matched so far) workaround / Alternative Pin
Lupu5R3x24-Jan-20 9:45
MemberLupu5R3x24-Jan-20 9:45 
QuestionCrystal Report Load Report failed error Pin
Member 1466074223-Jan-20 17:59
MemberMember 1466074223-Jan-20 17:59 
AnswerRe: Crystal Report Load Report failed error Pin
Pete O'Hanlon23-Jan-20 22:25
communityengineerPete O'Hanlon23-Jan-20 22:25 
AnswerRe: Crystal Report Load Report failed error Pin
thatraja28-Jan-20 2:37
professionalthatraja28-Jan-20 2:37 
QuestionI want to communicate with Graphdata from C# Core Pin
anil15087523-Jan-20 8:05
professionalanil15087523-Jan-20 8:05 
AnswerRe: I want to communicate with Graphdata from C# Core Pin
ZurdoDev23-Jan-20 8:35
mveZurdoDev23-Jan-20 8:35 
GeneralRe: I want to communicate with Graphdata from C# Core Pin
anil15087528-Jan-20 7:55
professionalanil15087528-Jan-20 7:55 
QuestionCAS REST API with C' shared login Ticket with Internet explorer or Edge Pin
MeAndCode23-Jan-20 4:19
MemberMeAndCode23-Jan-20 4:19 
QuestionDialogfenster auf- und zuklappen (Open and close dialog window) Pin
CopWorker23-Jan-20 1:36
MemberCopWorker23-Jan-20 1:36 
AnswerRe: Dialogfenster auf- und zuklappen (Open and close dialog window) Pin
Gerry Schmitz23-Jan-20 5:11
mveGerry Schmitz23-Jan-20 5:11 
QuestionGet Data From Deserialized List By Type Pin
Kevin Marois22-Jan-20 9:45
professionalKevin Marois22-Jan-20 9:45 
AnswerRe: Get Data From Deserialized List By Type Pin
Richard Deeming22-Jan-20 10:01
communityengineerRichard Deeming22-Jan-20 10:01 
GeneralRe: Get Data From Deserialized List By Type Pin
Kevin Marois22-Jan-20 10:15
professionalKevin Marois22-Jan-20 10:15 
GeneralRe: Get Data From Deserialized List By Type Pin
Kevin Marois22-Jan-20 12:12
professionalKevin Marois22-Jan-20 12:12 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.