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.
我只想提取配置单元中 IP 地址的前两个八位字节。谁能告诉我 Hive 支持的等效正则表达式?
例如,从 ip_address '192.96.45.33' 中提取 '192.96.0.0'。
192\\.96\\.\\d{3}\\.\\d{3}
猜猜这应该可以工作,因为 Hive 使用Java格式。
Java
或者
192\\.96\\.(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.)(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)