B
Boerni
Hi
I have a string which looks like this
text text %%slotname%% text text %%slotname%%...
What I would like to do, is to get the values between the '%%' signs. The
Problem is, I dont know how many of those %%slotname%% occur in the string.
Is there any way to solve this problem with a regex?
what i've tried is something like:
($slot1, $slot2, $slot3, $slot4, $slot5) = $a_msg =~
/.*?%%(.*?)%%.*?%%(.*?)%%.*?%%(.*?)%%.*?%%(.*?)%%.*?%%(.*?)%%/;
(assuming there are no more than 5 slots in a string)... the Problem is,
this only works if there are exactly 5 slots.
What i'd like is something like:
(@slots) = $a_msg =~ /some regex/
Is there any way to do this?
Thanks in advance
Bernard
I have a string which looks like this
text text %%slotname%% text text %%slotname%%...
What I would like to do, is to get the values between the '%%' signs. The
Problem is, I dont know how many of those %%slotname%% occur in the string.
Is there any way to solve this problem with a regex?
what i've tried is something like:
($slot1, $slot2, $slot3, $slot4, $slot5) = $a_msg =~
/.*?%%(.*?)%%.*?%%(.*?)%%.*?%%(.*?)%%.*?%%(.*?)%%.*?%%(.*?)%%/;
(assuming there are no more than 5 slots in a string)... the Problem is,
this only works if there are exactly 5 slots.
What i'd like is something like:
(@slots) = $a_msg =~ /some regex/
Is there any way to do this?
Thanks in advance
Bernard