Regexp frustration!
I am trying to break down this message:
media/Blackbird.m4v|Blackbird|Standard|anton|
by using regexp but I am unable. In fact it drives me crazy!
all I want is to separate each substring in the place where the | exists!
any ideas plz!
If you don't have spaces in your message (but something in your message looks like a filepath...), then fromsymbol @separator | may be enough for your needs.
p
thank you Patrick,
you are right the first part it is a file path and it may contain spaces. :-/
so I need a more general approach...
But if you really want to use regular expressions, try something like this:
regexp \| @substitute " "
You can use [fromsymbol @separator |] even if your message contains spaces, provided it's a single symbol (which should be in any case, otherwise you'd lose every sequence of multiple spaces that might appear in the file path).
aa
@Andrea true it seems that [fromsymbol @separator |] is working with spaces. What do u mean single symbol?
@Patrick that way [regexp \| @substitute " "] I can seperate them but I will loose track of the individual pieces if they contain spaces
Sorry, I didn't see you needed spaces before sending the regular expression.
This should work, using the 2nd outlet: regexp (.+)\|(.+)\|(.+)\|(.+)\|
p
Super!
That what I was trying to come up with but instaed of . I was using w :-)
thank you both of you!
Pretty much the same as Patrick's method but a little more efficient:
regexp ([^|]+)\|([^|]+)\|([^|]+)\|([^|]+)
This expression captures anything-that-isn't-a-vertical-bar between other vertical bar, it's a little bit speedier than the anything-at-all method.