• 05-08-2023, 13:01:34
    #1
    Selamlar, alt satırdaki değişkenin içerisindeki temp.late@xxxx.com:xxxx adresini nasıl regex kodu ile filtreleyebilirim?

    https://template.com/x/xxxx/string:t...@xxxx.com:xxxx
  • 05-08-2023, 13:11:36
    #2
    phyton ıcın

    import re
    
    metin = "Bazı rastgele metinler ve e-posta: temp.late@xxxx.com:xxxx ve daha fazla metin."
    
    regex_pattern = r"[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+:[a-zA-Z0-9-.]+"
    sonuc = re.findall(regex_pattern, metin)
    
    print(sonuc)
    php için

    <?php
    $metin = "test metin burası : temp.late@xxxx.com:xxxx ve daha fazla metin.";
    $regex_pattern = "/[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+:[a-zA-Z0-9-.]+/";
    
    preg_match_all($regex_pattern, $metin, $sonuc);
    
    print_r($sonuc[0]);
    ?>
  • 05-08-2023, 13:12:48
    #3
    $re = '/((:?.*):(.*\..*@.*\.com:.*))/m';
    $str = 'https://template.com/x/xxxx/string:temp.late@xxxx.com:xxxx';
    
    preg_match_all($re, $str, $matches, PREG_SET_ORDER, 0);
    
    // Print the entire match result
    var_dump($matches);


    bunu dene istersen.

    KokinUHD adlı üyeden alıntı: mesajı görüntüle
    Selamlar, alt satırdaki değişkenin içerisindeki temp.late@xxxx.com:xxxx adresini nasıl regex kodu ile filtreleyebilirim?

    https://template.com/x/xxxx/string:t...@xxxx.com:xxxx
  • 05-08-2023, 13:19:39
    #4
    samurat2000 adlı üyeden alıntı: mesajı görüntüle
    $re = '/((:?.*):(.*\..*@.*\.com:.*))/m';
    $str = 'https://template.com/x/xxxx/string:temp.late@xxxx.com:xxxx';
    
    preg_match_all($re, $str, $matches, PREG_SET_ORDER, 0);
    
    // Print the entire match result
    var_dump($matches);
    bunu dene istersen.
    çalıştı teşekkür ederim
  • 05-08-2023, 13:48:58
    #5
    Rica ederim. İyi çalışmalar dilerim.

    using System;
    using System.Text.RegularExpressions;
    
    public class Example
    {
        public static void Main()
        {
            string pattern = @"((:?.*):(.*\..*@.*\.com:.*))";
            string input = @"https://template.com/x/xxxx/string:temp.late@xxxx.com:xxxx";
            RegexOptions options = RegexOptions.Multiline;
            
            foreach (Match m in Regex.Matches(input, pattern, options))
            {
                Console.WriteLine("'{0}' found at index {1}.", m.Value, m.Index);
            }
        }
    }
    KokinUHD adlı üyeden alıntı: mesajı görüntüle
    çalıştı teşekkür ederim