hello frnds
I want to match and fetch the string from the db contents so is there a
method for it.
The contents can be [email protected] or also <a href mailto:[email protected]
from both the things I want to fetch only the email id i.e [email protected]
Can ne one help me out?
Thanks
Dhaval P.
ok thanks but what if I want to use the samething with for loop then
will it work?
thanks a lot
Dhaval P.
I am currently using .match(/\S+@\S+.\S+/) but i want to refine
it…for the last string i.e after . i want to restrict the no of char
to max 3 only the others should not be displayed …can ne one tell me
how to do it.
thanks
dhaval parikh
.match(/\S+@\S+.[a-zA-Z0-9]{3,3}/) (min number of char = 3 and max
number of char = 3)
.match(/\S+@\S+.[a-zA-Z0-9]{3}/) (min number of char = 3 and max
number of char = unlimited)
.match(/\S+@\S+.[a-zA-Z0-9]{,3}/) (min number of char = 0 and max
number of char = 3)
On Sep 6, 3:31 pm, Dhaval P. [email protected]
I you were not already, I want to make you aware that there are top
level domains with names longer than three characters. “museum” for
instance.
Wikipedia has the whole list:
This list of Internet top-level domains (TLD) contains top-level domains, which are those domains in the DNS root zone of the Domain Name System of the Internet. A list of the top-level domains by the Internet Assigned Numbers Authority (IANA) is maintained at the Root Zone Database. IANA also oversees the approval process for new proposed top-level domains for ICANN. As of April 2021[update], their root domain contains 1502 top-level domains. As of March 2021[update], the IANA root dat IANA...
thanks a lot to both of you i modified the code a bit as per your
suggestions
sure it will work, the value of data variable is going to be what ever
you want
example
array_of_objects = [“mailto:[email protected] ”, “[email protected] ”, …]
array_of_objects.delete_if { |data|
!(data =~ regex)
}
On Aug 22, 4:37 pm, Dhaval P. [email protected]