Jump to content

Regex Yazı Parçalama


pairs
 Share

Recommended Posts

  • Editor

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

Link to comment
Share on other sites

  • Editor
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.

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...