Aug-20-2021, 12:43 AM
i want to match part of a string against a regular expression. normally i would just slice the string and pass that part to re. but my code is not in control of the calls to re methods and only the whole strings are used. the only thing my code gets to control is the pattern. i have a small string of about 10 to 20 characters and i want this to be compared in only the first 80 characters of each string being matched with this pattern. i think i could do this if i needed to skip the first 80 and match the rest. but i need to match the first 80 to this smaller string i put in the pattern, and ignore (.*) everything after 80 (variable amount). there may be strings to match that are shorter than 80 in which the whole string is to be matched. how can i make a regular expression do this?
Tradition is peer pressure from dead people
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.