Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
文字列内の URL を抽出する必要があります。
私の場合、html テキストはデータベースにあり、そのテキストを取得し、テキスト内のすべての URL を検索して別のテーブルに挿入する必要がある場合、SQL または C# で URL を検索する方法を教えてください。
これは、テキスト内の URL を検索するための正規表現です
Regex regx = new Regex("http://([\\w+?\\.\\w+])+([a-zA-Z0-9\\~\\!\\@\\#\\$\\%\\^\\&\\*\\(\\)_\\-\\=\\+\\\\\\/\\?\\.\\:\\;\\'\\,]*)?", RegexOptions.IgnoreCase); MatchCollection mactches = regx.Matches(txt);