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

Patterns

Guides

  • Guide
  • MainGuide

Tech Notes

  • Match & Replace

Symbols

  • MatchBindings
  • MatchParts
  • MultiwayReplace
  • NameValuePattern
  • PatternMatch
Wolfram`Patterns`
MatchParts
​
​
MatchParts[match]
return parts of a pattern with associated values from a matched expression.
​
Examples  
(1)
Basic Examples  
(1)
In[1]:=
MatchParts

PatternMatch
[{a,b,c,d,e,f,g},{x___,y_,z__}]//Normal
Out[1]=
{{1}Sequence[],{2}Sequence[a],{3}Sequence[b,c,d,e,f,g],{1}Sequence[a],{2}Sequence[b],{3}Sequence[c,d,e,f,g],{1}Sequence[a,b],{2}Sequence[c],{3}Sequence[d,e,f,g],{1}Sequence[a,b,c],{2}Sequence[d],{3}Sequence[e,f,g],{1}Sequence[a,b,c,d],{2}Sequence[e],{3}Sequence[f,g],{1}Sequence[a,b,c,d,e],{2}Sequence[f],{3}Sequence[g]}
""

© 2025 Wolfram. All rights reserved.

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