was hoping anyone could help me figure out how to find the ‘/n’ in a string? It's just in the string attribute I am looping over as characters, and any other character it will find with re_find, but not these. I searched and tried a lot but did not succeed.
I'll post a hip file because I actually saw that a \n makes this little symbol when the string is made with a Attribute Create SOP. With the method I had it didn't and existed just as characters.
I suppose that this could be done. The newline character needs to be escaped.
stringstrings="this is a string array and \n this is a new line";s[]@words=re_split(r'( +)|(\\n)',strings);//Result:[this,is,a,string,array,and,"","",this,is,a,new,line]
I did try some stuff with that r’()’ before, even tho I do not understand it fully. But this code also doesn’t work in this hip file:
Also: I read that ‘regex’ is mostly the same, but that still different languages use different regex engines with small variations. If you want to learn regex for vex, is there a specific 'regex engine’ you should focus on?