hi list,
i was wondering if there is a way to evaluate regular expressions on a symbol in pd.
what i want to do is split a composite symbol, i.e:
"this-is-my-symbol"
into parts
"this", "is", "my", "symbol"
it would be nice to have a full perl style regexp extern, but for my application it suffices to split a symbol into two parts at the first occurance of some separator character, i.e "-"
maybe somebody already implemented this?
tom
maybe list2symbol and bakc a la split / / ..
Tom Schouten about [PD] regular expressions (symbol splitting) / Today
| |hi list, | |i was wondering if there is a way to evaluate regular expressions on a |symbol in pd. | |what i want to do is split a composite symbol, i.e: | |"this-is-my-symbol" | |into parts | |"this", "is", "my", "symbol" | |it would be nice to have a full perl style regexp extern, but for my |application it suffices to split a symbol into two parts at the first |occurance of some separator character, i.e "-" | |maybe somebody already implemented this? | |tom |
thanks for the reply but i dont see how l2s can solve this prob...
meanwhile, i wrote a quick and dirty extern symsplit that will split a symbol at the first '-'
i attached it, if anyone is interested
later tom
On woensdag, februari 27, 2002, at 11:15 , _-¯-_ wrote:
maybe list2symbol and bakc a la split / / ..
Tom Schouten about [PD] regular expressions (symbol splitting) / Today
| |hi list, | |i was wondering if there is a way to evaluate regular expressions on a |symbol in pd. | |what i want to do is split a composite symbol, i.e: | |"this-is-my-symbol" | |into parts | |"this", "is", "my", "symbol" | |it would be nice to have a full perl style regexp extern, but for my |application it suffices to split a symbol into two parts at the first |occurance of some separator character, i.e "-" | |maybe somebody already implemented this? | |tom |
-- X d v . o
7 G
I came up with a need to use regular expressions. In my case my goal was to get the just the filename from a full path.
Here is my hack;
#!/usr/bin/perl
$_ = $ARGV[0];
$_ =~ s|^.*/([^/]*)$|$1|; print $_;
Simply invoke the script via PD using
... | [/home/me/pd/filename.pl $1( | [shell] | [pack s] | ...
andy
hey apropos, shell seems to have the problem that all child processes dont quite go away after they finish, not until pd exits as a whole. this is nasty with high spawning frequences because you get maximum number of open file errors. wasnt there a fix for this already? i think it was in all the recent versions of ggee.
Andrew (Andy) W. Schmeder about Re: [PD] regular expressions (symbol...
|I came up with a need to use regular expressions. |In my case my goal was to get the just the filename from a full path. | |Here is my hack; | |------------ |#!/usr/bin/perl | |$_ = $ARGV[0]; | |$_ =~ s|^.*/([^/]*)$|$1|; |print $_; |------------ | |Simply invoke the script via PD using | |... | | |[/home/me/pd/filename.pl $1( | | |[shell] | | |[pack s] | | |... | | | |andy |