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
Regexten anlayan birisi yardımcı olabilir mi?
4
●112
- 05-08-2023, 13:11:36phyton ı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
$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 - 05-08-2023, 13:19:39çalıştı teşekkür ederimsamurat2000 adlı üyeden alıntı: mesajı görüntüle
- 05-08-2023, 13:48:58Rica 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