Dictionary actually beats the regex version and manual extraction of the first word improves perfomance even more ~65ms Perhaps there’s no reason to …
this one is pure python and it completes in a ~250ms on my ancient laptop. But hell knows how to pass the data to mxs import time import re words = …
don’t need to use so many variables, just use Dictionary with string key and integer value then simply check if the dictionary has the key (first word…
the only trouble I see is that not every match might be valid since “kappa*” pattern will match “kappa ” exactly as “kappaz”, that’s why I dismissed s…
miauu: You can see what the script has to do – find each line of the strToCheck which starts with one of predefined words and collect some data. …
ok, I see. python is order of magnitude slower for this expression @”(^|\n|\r)\s*kappa” which matches lines starting with kappa guess we have to writ…
denisT: after that it’s quick and easy to find the line of the substring. hmm… but it will require a linear search of the index that is larger th…
the regex syntax is pretty simple, still I’d suggest you to read some good book about how to write efficient expressions. It will make your life easie…
compared to a wall of text needed for c# python is definitely a winner
looks very promising. how do you convert these iterators to a mxs array?
ok, managed to test the code in max and it turns out issue with zero matches was with the regex patterns required another couple of slashes for word b…
did you try the link I posted above? It worked well and lists weren’t empty yes, you can print to the listener, but you’ll have to add autodesk.max.d…
if the input data is the same in both cases then it is something with the c# code
miauu: Can this version work if I sent a string, not a txt file? The one I posted? Yes, it works only for strings. If you want to read the text f…
if I’’m not mistaken this should print 42 ( a = #(1,2,3) ref = &a a = #(42) format “%\n” (*ref) )