I have a text where I would like to find different words.
(我有一个想在其中找到其他单词的文本。)
The following text is in Portuguese, Brazil, and serves only as a test case:(以下文本是巴西葡萄牙语,仅用作测试用例:)
Um dia eu conheci Pedro álvares Cabral, e descobri muitas informa??es interessantes.
To find any of the words in the text, I am using the following regular expression:
(要查找文本中的任何单词,我使用以下正则表达式:)
/(Cabral)/i // Finds Cabral
/(dia)/i // Finds dia
/(Pedro)/i // Finds Pedro
Etc...
If I need to find more than one word, I do as follows:
(如果需要查找多个单词,请执行以下操作:)
/(informa??es|muitas)/ig
I am testing the functionality of the expression in both JavaScript and using this online utility .
(我正在JavaScript和使用此在线实用程序中测试表达式的功能。)
JavaScript code example:(JavaScript代码示例:)
var input = "Um dia eu conheci Pedro álvares Cabral, e descobri muitas informa??es interessantes." var matchRegExp = new RegExp("\\b(coNHECi)\\b", "i"); if(regs = matchRegExp.exec(input)) { console.log('OK'); } else { console.log('NOPE'); }
THE PROBLEM(问题)
All the words I put into the expression are found, except álvares
.
(找到我在表达式中输入的所有单词,除了álvares
。)
For example, I cannot find the word with the following expression:(例如,我找不到具有以下表达式的单词:)
/(álvares)/i
If I remove the á
character, lvares
is found.
(如果删除á
字符, lvares
找到lvares
。)
I would like to:(我想要:)
- To know why and for what reason I can't find
álvares
.(要知道为什么以及为什么找不到álvares
。)
- To know how I can find any word in a text that has the following characters: áàa?áà??éèêéèêíì?íì?óò??óò??úù?úù????? regardless of whether these characters represent the first, last, or any letter of a word.
(要知道如何在具有以下字符的文本中找到任何单词:áà?áà?ééêééêeêíì??íì?óò??ò??ò??ú?úù??úù??????,无论这些字符代表单词的第一个,最后一个还是任何一个字母。)
ask by Loa translate from so
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…