Get position of paired brackets in a string

Get position of the other paired bracket (nested) in a string
33 Downloads
Updated 22 Jan 2019

View License

POS2 = GETBRACKETPAIRpos1(STR,POS1) gets the bracket pos1ition in a
string given the position of the other paired bracket.

Input:
STR : string (can be a nested string)
POS1: pos1ition of a bracket (can be either left or right)

Note:
1. Any bracket of '{[(<>)]}' can be recognized.
2. Input position can be either left or right bracket.
3. Mixed pair types are sup

Cite As

Newport Quantitative (2024). Get position of paired brackets in a string (https://www.mathworks.com/matlabcentral/fileexchange/70060-get-position-of-paired-brackets-in-a-string), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2018b
Compatible with any release
Platform Compatibility
Windows macOS Linux
Categories
Find more on Characters and Strings in Help Center and MATLAB Answers

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes
1.0.0