what does [^\n\r]' mean?
21 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Aga
el 21 de Mzo. de 2014
Comentada: Aga
el 24 de Mzo. de 2014
hi there, i have a sutpi question.. at the and of the string cpnversion specifiers of the matlab implemented import file function there is [^\n\r]. New line and carriage return is clear to me, but what the '^'means?..
formatSpec = '%s%s%s%s%f%f%f%s%s%s%[^\n\r]';
thanks in advance
aga
0 comentarios
Respuesta aceptada
per isakson
el 21 de Mzo. de 2014
Editada: per isakson
el 21 de Mzo. de 2014
"^" is a negation. %[^\r\n] matches everything but line break, i.e. the rest of the line. Doc says
Exclude characters inside the brackets, reading until the first matching
character.
3 comentarios
per isakson
el 21 de Mzo. de 2014
"~" is shorthand for the logical function not. (IMO: Use not, it makes the code more readable.) [^\r\n] is a loan from regular expression.
Más respuestas (0)
Ver también
Categorías
Más información sobre Whos en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!