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

basic authentication with http post params android -

vb.net - Virtual Keyboard commands -

css - Firefox for ubuntu renders wrong colors -