ruby - Regex for reverse match a string -


i want reverse match string using regex

ex: "test.com".match(/gmail.test.com/)(we can "gmail.test.com".match(/test.com/) have situation requires check inverse match).

is possible?. can me please.

thanks in advance!!

try:

> 'gmail.test.com'.split('.').last(2) == ['test','com'] => true  

Comments

Popular posts from this blog

android - Inheriting from Theme.AppCompat* -

broadcastreceiver - android BOOT_COMPLETED not received if not activity intent-filter -

basic authentication with http post params android -