Splitstring question
proland
I'm trying to use splitstring to separate data that is exported from some test equipment. An example string is as follows
0.501 Voc [V] following the format; Value Name [units]
My issue is with the square brackets. Since split string uses square brackets to indicate the substring types, such as ([[:digit:]]+) I am finding it difficult to indicate that the brackets are actually part of the string. My code worked fine for their older software, which used parenthesis for the units, but simply changing ( to [ did not work, nor did any of my other attempts to specifically state that the open and close bracket are actually in the string.
Any advice would be greatly appreciated.
-Paul
"\[" // this means 'match the literal character ['
But Igor accepts escaped characters too, and parses them, so you need double up every backslash. So to properly escape a symbol you need to put e.g.
\\[
in your regexp string.This is explained pretty well in the documentation. Try
DisplayHelpTopic "Backslash in Regular Expressions"
.July 29, 2011 at 07:58 am - Permalink
-Paul
July 29, 2011 at 08:35 am - Permalink