Project

General

Profile

Actions

Feature #19303

open

Resolv::IPv4::Regex variant without anchors

Added by henk (Hendrik Jäger) about 1 year ago.

Status:
Open
Assignee:
-
Target version:
-
[ruby-core:111591]

Description

require 'resolv'
p "match this IP: 10.0.0.1"[/match this IP: (#{Resolv::IPv4::Regex})/, 1]

This returns 'nil' because Resolv::IPv4::Regex is anchored with \A and \z.
I would like to have a variant of Resolv::IPv4::Regex available that is not anchored so that code would return '10.0.0.1'.

No data to display

Actions

Also available in: Atom PDF

Like0