lets say i have these two patterns
patternWord=r'[a-zA-Z]+' #word patterns
patternNum=r'[+-]?\d+.?\d*' #numbers patterns

can i make a third pattern that is made out of them?
patternTrhee= NOT patternWord AND NOT patternNUM?

so than it will find all others?
didnt find how to combine patterns and my teacher doesn't know either O_O

I am not expert in using re in Python, but could this example I made be relevant?

import sys
import re

pattern = re.compile(r'\w+')

# process the text of this program as input
with open('./file.txt') as inp:
    text = inp.read()
    match = re.findall(pattern, text)
    not_match = re.split(pattern, text)


    numbers = [m for m in match if m.isdigit()]

    words = [m for m in match if  not m.isdigit()]
Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.18 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.