0

A list of denied words, with a condition only if glued with symbols

//my arrays

      $Rejected_symbols = array('*','#','-','!','?','+','=','¨','^','~','@');
      $Rejected_if_with_symbols = array('t1','t2','t3','t4');

my search 1 - symbols always rejecteds

        $search = $Rejected_symbols;
        $replace = array('Forbidden symbol','Forbidden symbol','Forbidden symbol','x','x','x','x','x','x','x','x');
     (my-function) 

my search 2 - Words rejecteds, if theys are glueds with symbols

       $search = $Rejected_if_with_symbols;
       $replace = array('Prohibited combination','Prohibited combination','Prohibited combination','Prohibited combination'); 
    (my-function) 

my search 3, words always rejecteds and your array.

      $search = array('string1','string2','string3','string4');
     $replace = array('forbiten word','forbiten word','forbiten word','forbiten word');
     (my-function) 

In the first search, success, the forever prohibited symbols, In the third search, success, words that do not desire are always forbidden. But in SECOND search, words are always denied, and these are important must pass, only can be denied if they are glued with simbols in the first array.

  this words: ('t1','t2','t3','t4'); in seatch 2 Are always being denied, and I do not want this, I want them denied only if they are glued with symbols: 

       %t1 ou ?t1 ou +t1 etc.. 
Iori Sanch
  • 25
  • 7
  • try regex, also, what do you mean by forbidden? – Bagus Tesa Feb 20 '17 at 01:28
  • Hi Bagus :-) Thanks for replying! Sorry, I've improved the question, please give examples, I'm not very good, I'm learning. – Iori Sanch Feb 20 '17 at 02:15
  • $Variable1 = '!@#$%*(_+'; $Variable2 = 'abcdefgh'; @c would be denied #c denied %C denied, any $variable1 symbol that appears before any $variable2 words would be denied. Basically it's a question about values matches. Thanks – Iori Sanch Feb 20 '17 at 07:29
  • Please edit your question to add clarity. Do not add information to your question via comments. If you need a regex pattern written, you will have to offer a real sample of the string(s) and explain exactly what you want to capture. As is, the question is doomed to remain unanswered because it is not clear. – mickmackusa Mar 07 '17 at 16:23

0 Answers0