TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Regular expression to search for Gadaffi

74 点作者 marcog1大约 14 年前

7 条评论

colanderman大约 14 年前
Easy... (Qadaffi|Khadafy|Qadafi|...)... it's self-documented, maintainable, and assuming your regexp engine is actually a regexp engine, will compile to the same DFA that the obfuscated garbage in the SO solutions will compile to.<p>Writing compact regular expressions is like using short variable names to speed up a program. It only helps if your compiler is brain-dead.
评论 #2349797 未加载
评论 #2351653 未加载
yannickmahe大约 14 年前
Isn't it strange that there is no official transcription for Arab names?<p>Chinese, Japanese and Korean used to have a transcription by language (i.e. a transcription for the English language, another one for the french), but that got standardized, and now there is only one transcription for each word (except of course names that became really common: Peking in English, Pékin in French, Beijing in the now official pinyin transcription). Is it because the Arab language is separated in so many countries without a centralised system to "manage" the language?
评论 #2349580 未加载
评论 #2349567 未加载
评论 #2350192 未加载
评论 #2349549 未加载
评论 #2349548 未加载
edw519大约 14 年前
(G310|K310|Q310)<p><a href="http://en.wikipedia.org/wiki/Soundex" rel="nofollow">http://en.wikipedia.org/wiki/Soundex</a><p>I wouldn't expect too many false positives.
评论 #2350415 未加载
评论 #2350420 未加载
fedd大约 14 年前
while the regexp would find Ghaddafi in all latin script languages even if it's not understood, then let me suggest my Russian as well :)<p>Каддафи<p>btw, it's always written only this way, to the opposite of the Osama bin Laden situation, when some emigrant sources name him as Осама бин Ладен instead of the correct Усама бен Ладен.
marcog1大约 14 年前
Also see <a href="http://upload.wikimedia.org/math/6/1/f/61f34aa25871e9546b6a11243e1bed31.png" rel="nofollow">http://upload.wikimedia.org/math/6/1/f/61f34aa25871e9546b6a1...</a>
pbhjpbhj大约 14 年前
From the SO page: "I just thought that if the arabic transcription says Qaḏḏāfī, the regex should check for Qaddafi too."<p>Would any of these searches find an article that solely uses a phonetic spelling with diacritical marks as opposed to a "standard" alpha only transliteration?<p>I guess it depends on the engine used - in which case the question is do any regex engines do such automated conversion?
Mafana0大约 14 年前
There are over 32 accepted ways of spelling Mu'ammar al-Qadhafi. Here's a dance song to help you remember just a few of them: <a href="http://www.buzzfeed.com/danilic/gaddafi-the-duck-sauce-remix-1o3k" rel="nofollow">http://www.buzzfeed.com/danilic/gaddafi-the-duck-sauce-remix...</a>