How do I use regexpi on a phrase that has a "*"?

1 次查看(过去 30 天)
If * is used as a wildcard in regexp, how do I match to a phrase that has a star in it?
texta=find(~cellfun(@isempty, regexpi(Lines,'^text*, 'match')));
Instead of giving me the lines that have "text*" written out, it gives me all the lines :(

采纳的回答

Ben11
Ben11 2014-8-4
If I understood right using \* instead of * should work.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Characters and Strings 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by