extract word before and after character
Show older comments
i want to extract string before "(" and after " " or "," (space comma)
example:
input: pilo(52),iko(54);
result:
pilo
iko
4 Comments
Can you be more specific about what MATLAB class your input is? Here are some examples
in = ["pilo(52)","iko(54)"]
in = {"pilo(52)","iko(54)"}
in = {'pilo(52)','iko(54)'}
in = "pilo(52),iko(54)"
in = 'pilo(52),iko(54)'
Walter Roberson
on 19 Dec 2023
Is it ever possible for the input to have nested () ? For example,
pilo(sembei(93) fedora(s3))
Is it every possible for there to be digits in what is extracted? Is it ever possible for the part in () to be non-digits?
pilo17(52),iko(pippin)
aldo
on 19 Dec 2023
Accepted Answer
More Answers (0)
Categories
Find more on Characters and Strings in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!