Sep-14-2019, 03:51 AM (This post was last modified: Sep-14-2019, 08:13 PM by snippsat. Edited 1 time in total.)

a script i am working on will get a list of parameters to parse into parts. i am hoping re can do this for me but i am clueless how to make an appropriate regex. i can barely filter out .py files from a list of files.

each parameter is 3 decimal numbers each preceded with one of the characters "/" "@" or "+". the character in front identifies which number it is. for example, the number that follows "@" is the workspace number. for each parameter i need to get the 3 numbers (as 3 strings) identified with which character in front. for example i need to get the same results for "@1/2+3", "/2@1+3", "@1+3/2", "+3@1/2", "/2+3@1", and "+3/2@1". so it's more than just matching the pattern. it' associating various parts together in the right order. i think the match has to have a way to give a choice of any of the 3, each expressed with its leading character and which index it goes to, and do exactly 3 of them. but i don't know how to express this or how to be sure "@1@2/3" does not match (because "+" is missing). regex is a whole other language, harder than even lisp.

each parameter is 3 decimal numbers each preceded with one of the characters "/" "@" or "+". the character in front identifies which number it is. for example, the number that follows "@" is the workspace number. for each parameter i need to get the 3 numbers (as 3 strings) identified with which character in front. for example i need to get the same results for "@1/2+3", "/2@1+3", "@1+3/2", "+3@1/2", "/2+3@1", and "+3/2@1". so it's more than just matching the pattern. it' associating various parts together in the right order. i think the match has to have a way to give a choice of any of the 3, each expressed with its leading character and which index it goes to, and do exactly 3 of them. but i don't know how to express this or how to be sure "@1@2/3" does not match (because "+" is missing). regex is a whole other language, harder than even lisp.

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.