Tag Archives: wiktionary

Regex to extract two letter words

Extracting the two letter words from Wiktionary Category:English two-letter words https://en.wiktionary.org/wiki/Category:English_two-letter_words

Online, interactive regex tester: https://regex101.com/

Regex (will grab all 2 letter words including the explanation portion (in, of)):

/(\b[a-zA-Z]{2}\b)/g

Source Text:

Result:

 

Regex for grabbing from HTML (this will only result in the 2 letter words that are links:

Page source:

Result:

Wiktionary.org content text is available under the Creative Commons Attribution-ShareAlike License