智能生成和解释正则表达式,支持各种常见模式匹配
将您的文字指令转换为公式,或输入公式获取解释。
通过和AI对话来在线编辑Excel
使用AI将您的文字指令转换为SQL查询语句。
生成Excel VBA(Visual Basic for Applications)代码,用于自动化任务和创建Microsoft Excel中的自定义解决方案。
上传您的Excel文件,使用我们的AI驱动的图表生成器生成漂亮的图表。
使用我们的AI驱动的思维导图生成器将您的文本转换为漂亮的思维导图。轻松编辑和自定义您的思维导图。
使用AI智能生成和解释正则表达式,支持各种文本模式匹配和数据验证。
使用AI根据文字描述生成精美图片,支持多种尺寸,免费
http://www.example.com
https://example.com/path?query=123
ftp://ftp.example.org/resource.txt
www.example.com
example.com
以下正则表达式可匹配绝大多数标准 URL:
\b((?:https?|ftp):\/\/)?(?:www\.)?[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}(?:\/[^\s]*)?
import re
text = """
Visit our site at https://www.example.com or follow the docs at http://docs.example.org/page.
Also check ftp://ftp.example.com/file and plain www.test.com or example.net for more.
"""
pattern = r'\b((?:https?|ftp):\/\/)?(?:www\.)?[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}(?:\/[^\s]*)?'
urls = re.findall(pattern, text)
print(urls)
const text = `
Check https://www.example.com, http://example.org, ftp://files.example.net,
and also www.test.com or just example.co.
`;
const regex = /\b((?:https?|ftp):\/\/)?(?:www\.)?[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}(?:\/[^\s]*)?/g;
const urls = text.match(regex);
console.log(urls);
import java.util.regex.*;
import java.util.*;
public class URLMatcher {
public static void main(String[] args) {
String text = "Visit https://example.com or ftp://ftp.example.org.";
String regex = "\\b((?:https?|ftp):\\/\\/)?(?:www\\.)?[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}(?:\\/[^\\s]*)?";
Pattern pattern = Pattern.compile(regex);
Matcher matcher = pattern.matcher(text);
while (matcher.find()) {
System.out.println(matcher.group());
}
}
}
\b((?:https?|ftp):\/\/)?(?:www\.)?[a-zA-Z0-9.-]+\.(?:[a-zA-Z]{2,})(?::\d{1,5})?(?:\/[^\s]*)?
此正则支持: