View Single Post
Old 10-12-2019, 10:41 AM
jack_george jack_george is offline
Registered User
Join Date: Nov 2017
Posts: 12
Talking regular expression method to find specific word before specific index

i have index of specific word in paragraph and i need to get specific word and its index before this known index

i need to know if there is re method can help in this

paragraph: AP1 Fas 0/21 145 T B I AIR-CAP16 Gig 0.1 AP100 Fas 0/2 152 T B I AIR-CAP16 Gig 0.1 UNKOWN Fas 0/1 140 H P WSCC Port 1

word = "AIR-.*\w"

for ind,AP in enumerate(king):
    if, AP):
        m = ind-5
        n = ind-6

for i in z:

for o in q:

for H in range (len(AP1)):
    fin.append(AP2[H] + AP1[H])

Last edited by jdev; 10-14-2019 at 10:57 AM. Reason: wrap code in [code][/code] blocks for easier viewing
Reply With Quote