I have a list of words that I want to search in a string of large text.I have defined a function that returns each individual word but I dont know how to pass the function to re.findall(). I want to get any sentense that contains any word that is in words list.
Can someone assist :)
here is what I got:

```
strings = ['some large text', 'some large text'...]
ad = []
words = ['ascertained','deep','detected','disclosed','disinterred','espied','explored','exposed','famous','happened upon','identified','invented','learned','observed','perceived','presented','revealed','searched out','shown','sighted','spotted','unveiled']
def word():
    for i in words:
        t = word[i]
    return t

for i in range(len(strings)):
    ad += re.findall(r"([^.]*?word()[^.]*\.)",strings[i])
sep = ''
adc = sep.join(ad)

```
['https://Stackoverflow.com/questions/62770330', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/13863930/']
The problem was with the `transform.rotation` that was not able to change the rotation from -90/270 to new rotation. I instead had to use `transform.localRotation` and it worked perfectly.

```
using UnityEngine;
using System.Collections;

 public class ScaleAndRotate : MonoBehaviour { 
     public int startSize = 3;
     public int minSize = 1;
     public int maxSize = 6;

     public float speed = 2.0f;

     private Vector3 targetScale;
     private Vector3 baseScale;
     private int currScale;

     //ROT

     public Quaternion targetRotation;
     public Quaternion initialRotation;
     public bool startRotation = false;

     void Start() {
         baseScale = transform.localScale;
         transform.localScale = baseScale * startSize;
         currScale = startSize;
         targetScale = baseScale * startSize;

         initialRotation = transform.localRotation;
     }

     void Update() {
         transform.localScale = Vector3.Lerp (transform.localScale, targetScale, speed * Time.deltaTime);

         if(startRotation == true)
         {
             transform.localRotation = Quaternion.Slerp(transform.localRotation, targetRotation, Time.deltaTime * speed);
         }
         else
         if(startRotation == false)
         {
             //Go Back To Initial Rotation
             transform.localRotation = Quaternion.Slerp(transform.localRotation, initialRotation, Time.deltaTime * speed);
         }

         if (Input.GetKeyDown (KeyCode.UpArrow))
         {
             ChangeSize (true);
             startRotation = false;
         }

         if (Input.GetKeyDown (KeyCode.DownArrow))
         {
             ChangeSize (false);
             startRotation = true;
         }

     }

     public void ChangeSize(bool bigger) {

         if (bigger)
         {
             currScale++;

         }

         else
         {
             currScale--;

         }

         currScale = Mathf.Clamp (currScale, minSize, maxSize+1);

         targetScale = baseScale * currScale;
     }    
 }

```
I think the problem is that you miss brackets when you use `if` statements:

```
         if (Input.GetKeyDown (KeyCode.UpArrow))
             ChangeSize (true);
             startRotation = true;
         if (Input.GetKeyDown (KeyCode.DownArrow))
             ChangeSize (false);
             startRotation = false;

```

When you use something like that code above the `if` is used only to the first following line of code. Thus, add brackets to that code:

```
if (Input.GetKeyDown (KeyCode.UpArrow))
{
             ChangeSize (true);
             startRotation = true;
}
         if (Input.GetKeyDown (KeyCode.DownArrow))
{
             ChangeSize (false);
             startRotation = false;
}

```