Skip to main content

Type Alias: SoftWordBreakPattern

SoftWordBreakPattern = string

Defined in: cspell-types/dist/index.d.mts:1422

Defines a word break rule based on a string.

Format:

  • "before|after" -- Matches a word break between before and after
  • "before|after$" -- Matches a word break between before and after at the end of a word
  • "^before|after" -- Matches a word break between before at the start of a word and after
  • "^before|after$" -- Matches a word break between before at the start of a word and after at the end of a word
  • "before|" -- Matches a word break after before
  • "^before|" -- Matches a word break after before at the start of a word
  • "|after" -- Matches a word break before after
  • "|after$" -- Matches a word break before after at the end of a word

Where before is the text before the word break and after is the text after the word break.

Special characters like |, ^, and $ have specific meanings.

  • | -- Represents the position of the word break
  • ^ -- Indicates the start of a word
  • $ -- Indicates the end of a word

For more complicated word break rules, consider using regular expressions with the SoftWordBreakRegExp type.

Examples:

  • "^ptr|" -- Would help with pointer definitions starting with ptr, such as ptrvalue.
  • "^I|" -- Would help with interface definitions starting with I, such as IERROR.

Since

10.3.1