Wolfram Language Paclet Repository

Community-contributed installable additions to the Wolfram Language

Primary Navigation

    • Cloud & Deployment
    • Core Language & Structure
    • Data Manipulation & Analysis
    • Engineering Data & Computation
    • External Interfaces & Connections
    • Financial Data & Computation
    • Geographic Data & Computation
    • Geometry
    • Graphs & Networks
    • Higher Mathematical Computation
    • Images
    • Knowledge Representation & Natural Language
    • Machine Learning
    • Notebook Documents & Presentation
    • Scientific and Medical Data & Computation
    • Social, Cultural & Linguistic Data
    • Strings & Text
    • Symbolic & Numeric Computation
    • System Operation & Setup
    • Time-Related Computation
    • User Interface Construction
    • Visualization & Graphics
    • Random Paclet
    • Alphabetical List
  • Using Paclets
    • Get Started
    • Download Definition Notebook
  • Learn More about Wolfram Language

LexicalCases

Guides

  • LexicalCases

Tech Notes

  • LexicalCases Overview

Symbols

  • BoundToken
  • CountSummaryLowercase
  • DataJoin
  • ExpandPattern
  • FormatLexicalPattern
  • HideMissing
  • LexicalCases
  • LexicalDispersionPlot
  • LexicalDispersionSmoothHistogram
  • LexicalMap
  • LexicalPattern
  • LexicalPatternQ
  • LexicalStructure
  • LexicalSummary
  • LexigramCount
  • MaxCategories
  • OptionalToken
  • Sandwich
  • StopWordQ
  • SynonymToken
  • TextType
  • ToLexicalPattern
  • TypeToken
  • WordToken
  • $FilterableProperties
  • $LexicalCasesServices
  • $SampleParagraph
  • $SampleSentence
  • $SampleStringExpression
FaizonZaman`LexicalCases`
BoundToken
​
BoundToken
[lp]
represents a bounded form of the lexical pattern
lp
​
​
BoundToken
[
lp
​
1
|
lp
​
2
|…]
represents a bounded form of the
lp
​
i
​
​
BoundToken
[outer,inner]
represents lexical pattern
inner
bounded by
outer
on both sides
​
Details and Options

Examples  
(4)
Basic Examples  
(3)
BoundToken
expands its argument with boundary patterns.
In[1]:=
ExpandPattern
"The great machine whirs. The weak machines sputter.","great""weak"~~
BoundToken
["machine"|"machines"]
Out[1]=
great|weak~~WordBoundary| |StartOfString|StartOfLine~~machine|machines~~WordBoundary| |EndOfString|EndOfLine
​
The first example matches the phrase
"great machine"
, and the second matches the phrase
"weak machines"
In[1]:=
LexicalCases
"The great machine whirs. The weak machines sputter.","great"~~
BoundToken
["machine"]["Data"]
Out[1]=
{Matchgreat machine,Position{{5,17}}}
In[2]:=
LexicalCases
"The great machine whirs. The weak machines sputter.","weak"~~
BoundToken
["machines"]["Data"]
Out[2]=
{Matchweak machines,Position{{30,42}}}
​
Find tokens surrounded by 0's:
In[1]:=
LexicalCases
"Hey 0this0 is what I was 0looking0 for.",
BoundToken
["0","this"|"looking"]["Data"]
Out[1]=
{Match0this0,Position{{5,10}},Match0looking0,Position{{26,34}}}
Scope  
(1)

SeeAlso
WordBoundary
 
▪
StartOfLine
 
▪
EndOfLine
 
▪
StartOfString
 
▪
EndOfString
 
▪
StringExpression
 
▪
String
Tutorials
▪
LexicalCases Overview
RelatedGuides
▪
LexicalCases
RelatedLinks
▪
LexicalCases GitHub Repository
""

© 2025 Wolfram. All rights reserved.

  • Legal & Privacy Policy
  • Contact Us
  • WolframAlpha.com
  • WolframCloud.com