#K14526. Extract Valid Email Addresses
Extract Valid Email Addresses
Extract Valid Email Addresses
You are given a string that may contain one or more email addresses mixed with other text. Your task is to extract all valid email addresses in the order they appear in the text. A valid email address is defined by the following regular expression in LaTeX format:
\( [a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,} \)
If at least one valid email address is found, print each email on a separate line. Otherwise, print exactly No emails found
.
inputFormat
The input consists of a single string which may span multiple lines. This string contains arbitrary text in which valid email addresses may be embedded.
You should read the input from standard input (stdin).
outputFormat
If one or more valid email addresses are found, output each email address on its own line in the order of appearance. If none are found, output exactly No emails found
.
Write the output to standard output (stdout).
## samplePlease contact us at support@company.com or sales@company.io. Alternatively, reach out to john.doe@company.com
support@company.com
sales@company.io
john.doe@company.com
</p>