regular expresion problem



I am trying to figure out the regular expression problem
In case of $test1, I want to have @@@_ as a result
and for $test2 @@@+. How can i achieve this?
When testing $test1 variable always gives me @@@_@@_A
as a output string. I don't know why this happen either.

//$test1 = "@@@_@@_AAA";
$test2 = "@@@+@@+AAA";

$prefec_test = "/(.*[\+_]).*/";
if(preg_match_all($prefec_test, $test, $item)){
foreach($item[1] as $link)
{
echo $link;
}
}

Thanks in advance.

MD.



.



Relevant Pages

  • Re: Junit newbie
    ... > time in junit versus my actual class. ... > iteratively test de/compressing a single byte array with the values ranging ... As to what if test2 requires test1 to pass? ...
    (comp.lang.java.help)
  • Re: semBCreate, SEM_Q_FIFO
    ... The problem is definitely one of context switching and scheduling. ... The two tasks (test1 and test2) were at the same priority. ... next iterations of task1 will be so fast that task1 will finish ...
    (comp.os.vxworks)
  • Re: Changing the local admin password base on the computers OU
    ... You can put the common code of the two IF-bodies in front of them, ... 'Change the local admin pwd for OU TEST1 ... 'Change the local admin pwd for OU TEST2 ... I do not know what it means to test for a computers membership in ...
    (microsoft.public.scripting.vbscript)
  • Re: Validation Options with option List
    ... If you are talking about actual tests (e.g. test1 has several questions, ... test2 has several questions and so on) you can do this. ... > Could you not just add a simple IF test in an adjoining cell ... >> i have set up an validation list option in Excel so i can choose what ...
    (microsoft.public.excel.misc)
  • data comprised of regexs (while loop weirdness)
    ... why do I only see a yes when passing the last data entry (test3) as ... <end code snipet> ...
    (comp.lang.perl.misc)