regex
ukos
I have a regex search function for the SplitString Function looking like this:
String prefix, suffix
String regex = "(.*)\\bG\\b(.*)"
String target = "gnoise(G)"
SplitString/E=regex target, prefix, suffix
if(V_flag == 2)
print prefix, "<found>", suffix
endif
String regex = "(.*)\\bG\\b(.*)"
String target = "gnoise(G)"
SplitString/E=regex target, prefix, suffix
if(V_flag == 2)
print prefix, "<found>", suffix
endif
Do I need to double escape the WORD characters? - Single Escaping also seems to work. How is Igor handling it internally. If I were in vim or grep on the cli, double escaping would be required because the pattern is parsed once by them editor. How about igor?
The key part is:
Igor's literal string interpreter converts \<character> to something else if is one of the characters that it recognizes. At present, it converts \t to tab, \r to carriage return, \n to linefeed, \" to double quote, \' to single quote, and \\ to backslash and certain other patterns to numbers. For details, execute:
or
In your example, you could use "\b" or "\\b" because, at present, Igor does not convert "\b" to anything.You should not assume this but rather follow the rule stated above.
October 22, 2016 at 02:25 pm - Permalink
October 24, 2016 at 11:54 am - Permalink