Joining two regexps

E

Edgardo Hames

Hi, everybody.

I would like to join two regular expression, actually place a regexp
_inside_ another one, like:

IP_ADDRESS = %r{(?:\d{1,3}\.){3}\d{1,3}}
RESPONSE = %r{SERVER IP_ADDRESS}

In RESPONSE, IP_ADDRESS should be the pattern that matches an IP
address, but I don't figure out how to do that. Could you please help
me?

Thaks a lot,
Ed
 
I

Ilmari Heikkinen

Hi,

Hi, everybody.

I would like to join two regular expression, actually place a regexp
_inside_ another one, like:

IP_ADDRESS = %r{(?:\d{1,3}\.){3}\d{1,3}}
RESPONSE = %r{SERVER IP_ADDRESS}

In RESPONSE, IP_ADDRESS should be the pattern that matches an IP
address, but I don't figure out how to do that. Could you please help
me?

RESPONSE = %r{SERVER #{IP_ADDRESS}}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top