TAIPEI, Taiwan (AP) _ Five years ago, Horatio Nelson moved to this affluent island from Boulder, Colo., with $100 in his pocket and dreams of a new, exciting life.

He became fluent in Mandarin Chinese, married a Taiwanese woman, landed a job with a major Taiwanese electronics company and qualified for an alien residence certificate.

Then, in May, Taiwan passed a law restricting the employment of foreigners.

Like some of the other 100,000 foreigners who live in Taiwan, Nelson, 32, lost his job. His two years in marketing did not qualify him as a ''foreign expert'' allowed to work in Taiwan.

''Taiwan has projected an anti-foreigner sentiment,'' Nelson said angrily. ''With this new law, it is shooting itself in the foot. I have worked hard on my own to help Taiwan, but look how I am rewarded. This is absurd.''

Nelson's wife sells water purifiers, and they now get along on her income.

Criticism of the new law, and the danger of losing foreign capital and expertise as a result, have prompted the government to consider changing it. Taiwan has always had flexible visa requirements, often turning a blind eye to foreigners who arrived on tourist visas and then taught English or found other jobs.

That changed with the Employment Service Act. Officials of the government Labor Council, which drafted the law, said new rules were necessary to control thousands of illegal workers hoping to cash in on Taiwan's robust economy, which grew by 7.3 percent last year.

Some other countries in the region have more restrictive rules than Taiwan. Japan prohibits the hiring of foreign manual laborers and South Korea grants only limited work visas to foreigners.

Taiwanese officials acknowledge that the new law makes no allowance for foreigners who hold alien residence certificates. Some foreigners feel it targets Americans and others say its goal is to curb Japanese influence on the island's economy.

Nearly 24,000 Americans live in Taiwan, making them the largest expatriate group.

All foreigners must apply for working papers, which were not required previously, and there are several requirements for hiring foreign professionals.

Only domestic companies with minimum paid-in capital equivalent to $800,000 or foreign ones with capital of $160,000 may employ foreigners. Employers who hire foreigners without proper authorization are subject to prison sentences of five years and fines up to $60,000.

More than white-collar workers are affected. Foreign street musicians have disappeared from Taipei. Police raided a bar, put an American guitarist in jail for three hours and threatened to deport his family.

Park Hong Shik, vice chairman of the Koreans Association in Taipei, said the law ''deprives thousands of foreigners who have lived here for decades of their working rights.''

He lost his job at a trading company that was deemed too small to hire foreign nationals.

His association has petitioned the Foreign Ministry and Labor Council for equal working rights, Park said, and will urge all 4,000 Koreans in Taiwan to leave if the appeal is ignored.

Other expatriates say Taiwan's international image could be damaged.

''If the Taiwan government wants to proceed to become a regional financial center, it should be more open,'' said James O'Hearn, president of the American Chamber of Commerce in Taipei.

Hiroshi Yamaguchi, chairman of the Japanese Chamber of Commerce and Industry, said the restrictions would discourage investment and technology transfers from Japan.

The government appears to be having second thoughts.

At a meeting with foreign business leaders in July, Economics Minister Vincent Siew said he would consult the Labor Council about possible changes in the law.

''We understand this is an urgent issue,'' he said. ''Foreigners used to come and go freely, but now they have to apply for work permits. These new rules have puzzled them.''

On July 27, Premier Hau Pei-tsun told the Labor Council that Taiwan should ''strictly screen importation of blue-collar foreign workers, while treating white-collar foreign workers leniently on the basis of mutual benefit.''