Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Q&A

Post History

60%
+1 −0
Q&A Autocapitalize/correct two connected words?

Two possible approaches. Before you start typing your text. You can set up a list of auto-complete words. From Project -> Project Settings -> autocomplete. After you typed. You can use the ...

posted 6y ago by _X_‭  ·  last activity 5y ago by System‭

Answer
#4: Attribution notice removed by user avatar System‭ · 2019-12-18T21:34:23Z (about 5 years ago)
Source: https://writers.stackexchange.com/a/43770
License name: CC BY-SA 3.0
License URL: https://creativecommons.org/licenses/by-sa/3.0/
#3: Attribution notice added by user avatar System‭ · 2019-12-08T11:24:38Z (about 5 years ago)
Source: https://writers.stackexchange.com/a/43770
License name: CC BY-SA 3.0
License URL: https://creativecommons.org/licenses/by-sa/3.0/
#2: Initial revision by (deleted user) · 2019-12-08T11:24:38Z (about 5 years ago)
Two possible approaches.

1. **Before you start typing your text.** You can set up a list of auto-complete words. From Project -\> Project Settings -\> autocomplete.

2. **After you typed.** You can use the find command in Edit -\> Find. Set the Find Options to Regular Expressions (regex). Place the desired Regular expression in the top box, and Slime Monster in the lower box. Make sure you tick the ignore case box and you are good to go. _If you are worried that the regex will have false positives, you can click on Next and only replace those occurrences that look wrong._

## A bit on Regex.

This requires some knowledge of what regex can do. The one fitting your request could be a search for the two words containing the letters of Slime and Monster.

    \b[slime]+\b \b[monster]+\b

Note that this will also match any pair of words whose letters are included in slime and in monster, e.g. "me so" and "see soon"

A bit more complex regex, which is also more accurate, could be:

    \b(?=\b(?:[^slime]*[slime]){4,6}[^slime]*\b)[slime]{4,6}\b \b(?=\b(?:[^monster]*[monster]){5,8}[^monster]*\b)[monster]{5,8}\b

[slime]{4,6} tries to match any word made from the letters in slime, with length between 4 and 6. The whole thing tries to match a pair of words, the first of which is between 4 and 6 letters and is composed only of letters from "slime", and the second is between 5 and 8 letters and is composed only of the letters found in "monster". Note that there is a space in between the two, which is also used in the matching.

As written above, do not forget to check the ignore case if you want to correct the capitalization as well.

This answer was inspired by the excellent SO answer: [https://stackoverflow.com/questions/4389644/regex-to-match-string-containing-two-names-in-any-order](https://stackoverflow.com/questions/4389644/regex-to-match-string-containing-two-names-in-any-order)

#1: Imported from external source by user avatar System‭ · 2019-03-19T16:58:52Z (almost 6 years ago)
Original score: 2