Editor pairs Posted August 10, 2014 Editor Share Posted August 10, 2014 Merhaba arkadaşlar elimde bu şekilde parça olarak gelen bi yazı var bunun regex desenini oluşturamadım bi türlü yardım edebilecek varmıdır regex ten iyi anlayan. 557284 -- Haengerchen m. Kapuze3320 445 13,82 6.149,90 EUR bu yazıyı regex ile parçalamak istiyorum Quote Link to comment Share on other sites More sharing options...
Editor pairs Posted August 10, 2014 Author Editor Share Posted August 10, 2014 string sVal = "557284 -- Haengerchen masd Kapuze3320 445 13,82 216.149,90 EUR"; Match s = Regex.Match(sVal, @"^[0-9]*"); //MessageBox.Show(s.Value); sReport += "\n" + s.Value; sVal = sVal.Replace(s.Value, ""); Match s2 = Regex.Match(sVal, @"^( *)(--|[a-zA-Z]*)"); //MessageBox.Show(s2.Value); sReport += "\n" + s2.Value; sVal = sVal.Replace(s2.Value, ""); Match s3 = Regex.Match(sVal, @"^( *)([a-zA-Z]*( *))*"); //MessageBox.Show(s3.Value); sReport += "\n" + s3.Value; sVal = sVal.Replace(s3.Value, ""); Match s4 = Regex.Match(sVal, @"^( *)([0-9]*)"); //MessageBox.Show(s4.Value); sReport += "\n" + s4.Value; sVal = sVal.Replace(s4.Value, ""); Match s5 = Regex.Match(sVal, @"^( *)([0-9]*)"); //MessageBox.Show(s5.Value); sReport += "\n" + s5.Value; sVal = sVal.Replace(s5.Value, ""); Match s6 = Regex.Match(sVal, @"^( *)[0-9]*(,*)[0-9]*"); //MessageBox.Show(s6.Value); sReport += "\n" + s6.Value; sVal = sVal.Replace(s6.Value, ""); Match s7 = Regex.Match(sVal, @"^( *)((\d{1}|\d{2}|\d{3})\.\d{3}\,\d{2})"); //MessageBox.Show(s7.Value); sReport += "\n" + s7.Value; sVal = sVal.Replace(s7.Value, ""); MessageBox.Show(sReport); Sorunumu bu şekilde parçalayarak çözdüm arkadaşlar. Bana gecenin 5 inde bile yardım eden samet kardeşime teşekkürlerimi sunarım. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.