<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ru">
		<id>http://www.jexp.ru/index.php?action=history&amp;feed=atom&amp;title=Java%2FRegular_Expressions%2FIP_Address</id>
		<title>Java/Regular Expressions/IP Address - История изменений</title>
		<link rel="self" type="application/atom+xml" href="http://www.jexp.ru/index.php?action=history&amp;feed=atom&amp;title=Java%2FRegular_Expressions%2FIP_Address"/>
		<link rel="alternate" type="text/html" href="http://www.jexp.ru/index.php?title=Java/Regular_Expressions/IP_Address&amp;action=history"/>
		<updated>2026-04-22T03:31:31Z</updated>
		<subtitle>История изменений этой страницы в вики</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>http://www.jexp.ru/index.php?title=Java/Regular_Expressions/IP_Address&amp;diff=6027&amp;oldid=prev</id>
		<title>Admin: 1 версия</title>
		<link rel="alternate" type="text/html" href="http://www.jexp.ru/index.php?title=Java/Regular_Expressions/IP_Address&amp;diff=6027&amp;oldid=prev"/>
				<updated>2010-06-01T06:00:51Z</updated>
		
		<summary type="html">&lt;p&gt;1 версия&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr style=&quot;vertical-align: top;&quot; lang=&quot;ru&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Предыдущая&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Версия 06:00, 1 июня 2010&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; style=&quot;text-align: center;&quot; lang=&quot;ru&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(нет различий)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	<entry>
		<id>http://www.jexp.ru/index.php?title=Java/Regular_Expressions/IP_Address&amp;diff=6026&amp;oldid=prev</id>
		<title> в 18:01, 31 мая 2010</title>
		<link rel="alternate" type="text/html" href="http://www.jexp.ru/index.php?title=Java/Regular_Expressions/IP_Address&amp;diff=6026&amp;oldid=prev"/>
				<updated>2010-05-31T18:01:43Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Новая страница&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== Regex for IP v4 Address ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
/*&lt;br /&gt;
 * $HeadURL: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/conn/util/InetAddressUtils.java $&lt;br /&gt;
 * $Revision: 652020 $&lt;br /&gt;
 * $Date: 2008-04-27 22:23:31 +0100 (Sun, 27 Apr 2008) $&lt;br /&gt;
 * &lt;br /&gt;
 * &lt;br /&gt;
 * Licensed to the Apache Software Foundation (ASF) under one&lt;br /&gt;
 * or more contributor license agreements.  See the NOTICE file&lt;br /&gt;
 * distributed with this work for additional information&lt;br /&gt;
 * regarding copyright ownership.  The ASF licenses this file&lt;br /&gt;
 * to you under the Apache License, Version 2.0 (the&lt;br /&gt;
 * &amp;quot;License&amp;quot;); you may not use this file except in compliance&lt;br /&gt;
 * with the License.  You may obtain a copy of the License at&lt;br /&gt;
 *&lt;br /&gt;
 *   http://www.apache.org/licenses/LICENSE-2.0&lt;br /&gt;
 *&lt;br /&gt;
 * Unless required by applicable law or agreed to in writing,&lt;br /&gt;
 * software distributed under the License is distributed on an&lt;br /&gt;
 * &amp;quot;AS IS&amp;quot; BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY&lt;br /&gt;
 * KIND, either express or implied.  See the License for the&lt;br /&gt;
 * specific language governing permissions and limitations&lt;br /&gt;
 * under the License.&lt;br /&gt;
 * &lt;br /&gt;
 *&lt;br /&gt;
 * This software consists of voluntary contributions made by many&lt;br /&gt;
 * individuals on behalf of the Apache Software Foundation.  For more&lt;br /&gt;
 * information on the Apache Software Foundation, please see&lt;br /&gt;
 * &amp;lt;http://www.apache.org/&amp;gt;.&lt;br /&gt;
 *&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
import java.util.regex.Pattern;&lt;br /&gt;
/**&lt;br /&gt;
 * A collection of utilities relating to InetAddresses.&lt;br /&gt;
 */&lt;br /&gt;
public class InetAddressUtils {&lt;br /&gt;
    private InetAddressUtils() {&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    private static final Pattern IPV4_PATTERN = &lt;br /&gt;
        Pattern.rupile(&lt;br /&gt;
                &amp;quot;^(25[0-5]|2[0-4]\\d|[0-1]?\\d?\\d)(\\.(25[0-5]|2[0-4]\\d|[0-1]?\\d?\\d)){3}$&amp;quot;);&lt;br /&gt;
    private static final Pattern IPV6_STD_PATTERN = &lt;br /&gt;
        Pattern.rupile(&lt;br /&gt;
                &amp;quot;^(?:[0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}$&amp;quot;);&lt;br /&gt;
    private static final Pattern IPV6_HEX_COMPRESSED_PATTERN = &lt;br /&gt;
        Pattern.rupile(&lt;br /&gt;
                &amp;quot;^((?:[0-9A-Fa-f]{1,4}(?::[0-9A-Fa-f]{1,4})*)?)::((?:[0-9A-Fa-f]{1,4}(?::[0-9A-Fa-f]{1,4})*)?)$&amp;quot;);&lt;br /&gt;
    public static boolean isIPv4Address(final String input) {&lt;br /&gt;
        return IPV4_PATTERN.matcher(input).matches();&lt;br /&gt;
    }&lt;br /&gt;
    public static boolean isIPv6StdAddress(final String input) {&lt;br /&gt;
        return IPV6_STD_PATTERN.matcher(input).matches();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    public static boolean isIPv6HexCompressedAddress(final String input) {&lt;br /&gt;
        return IPV6_HEX_COMPRESSED_PATTERN.matcher(input).matches();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    public static boolean isIPv6Address(final String input) {&lt;br /&gt;
        return isIPv6StdAddress(input) || isIPv6HexCompressedAddress(input); &lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- end source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Regex for IP v6 Address ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
/*&lt;br /&gt;
 * $HeadURL: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/conn/util/InetAddressUtils.java $&lt;br /&gt;
 * $Revision: 652020 $&lt;br /&gt;
 * $Date: 2008-04-27 22:23:31 +0100 (Sun, 27 Apr 2008) $&lt;br /&gt;
 * &lt;br /&gt;
 * &lt;br /&gt;
 * Licensed to the Apache Software Foundation (ASF) under one&lt;br /&gt;
 * or more contributor license agreements.  See the NOTICE file&lt;br /&gt;
 * distributed with this work for additional information&lt;br /&gt;
 * regarding copyright ownership.  The ASF licenses this file&lt;br /&gt;
 * to you under the Apache License, Version 2.0 (the&lt;br /&gt;
 * &amp;quot;License&amp;quot;); you may not use this file except in compliance&lt;br /&gt;
 * with the License.  You may obtain a copy of the License at&lt;br /&gt;
 *&lt;br /&gt;
 *   http://www.apache.org/licenses/LICENSE-2.0&lt;br /&gt;
 *&lt;br /&gt;
 * Unless required by applicable law or agreed to in writing,&lt;br /&gt;
 * software distributed under the License is distributed on an&lt;br /&gt;
 * &amp;quot;AS IS&amp;quot; BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY&lt;br /&gt;
 * KIND, either express or implied.  See the License for the&lt;br /&gt;
 * specific language governing permissions and limitations&lt;br /&gt;
 * under the License.&lt;br /&gt;
 * &lt;br /&gt;
 *&lt;br /&gt;
 * This software consists of voluntary contributions made by many&lt;br /&gt;
 * individuals on behalf of the Apache Software Foundation.  For more&lt;br /&gt;
 * information on the Apache Software Foundation, please see&lt;br /&gt;
 * &amp;lt;http://www.apache.org/&amp;gt;.&lt;br /&gt;
 *&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
import java.util.regex.Pattern;&lt;br /&gt;
/**&lt;br /&gt;
 * A collection of utilities relating to InetAddresses.&lt;br /&gt;
 */&lt;br /&gt;
public class InetAddressUtils {&lt;br /&gt;
    private InetAddressUtils() {&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    private static final Pattern IPV4_PATTERN = &lt;br /&gt;
        Pattern.rupile(&lt;br /&gt;
                &amp;quot;^(25[0-5]|2[0-4]\\d|[0-1]?\\d?\\d)(\\.(25[0-5]|2[0-4]\\d|[0-1]?\\d?\\d)){3}$&amp;quot;);&lt;br /&gt;
    private static final Pattern IPV6_STD_PATTERN = &lt;br /&gt;
        Pattern.rupile(&lt;br /&gt;
                &amp;quot;^(?:[0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}$&amp;quot;);&lt;br /&gt;
    private static final Pattern IPV6_HEX_COMPRESSED_PATTERN = &lt;br /&gt;
        Pattern.rupile(&lt;br /&gt;
                &amp;quot;^((?:[0-9A-Fa-f]{1,4}(?::[0-9A-Fa-f]{1,4})*)?)::((?:[0-9A-Fa-f]{1,4}(?::[0-9A-Fa-f]{1,4})*)?)$&amp;quot;);&lt;br /&gt;
    public static boolean isIPv4Address(final String input) {&lt;br /&gt;
        return IPV4_PATTERN.matcher(input).matches();&lt;br /&gt;
    }&lt;br /&gt;
    public static boolean isIPv6StdAddress(final String input) {&lt;br /&gt;
        return IPV6_STD_PATTERN.matcher(input).matches();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    public static boolean isIPv6HexCompressedAddress(final String input) {&lt;br /&gt;
        return IPV6_HEX_COMPRESSED_PATTERN.matcher(input).matches();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    public static boolean isIPv6Address(final String input) {&lt;br /&gt;
        return isIPv6StdAddress(input) || isIPv6HexCompressedAddress(input); &lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- end source code --&amp;gt;&lt;/div&gt;</summary>
			</entry>

	</feed>