RegEx editors

darrell dgallion1 at yahoo.com
Thu Sep 19 04:31:57 CEST 2002


import re

while 1:
    buf=eval('"""%s"""'%raw_input("Enter string to search:"))
    print buf
    while 1:
        pat=raw_input("Enter pattern:")
        if len(pat)==0:
            break
        mo=re.search(pat, buf)
        if mo:
            print mo.groups()
        else:
            print ""
            
##########################################
Enter string to search:now is the \n time for
now is the
 time for
Enter pattern:(?s)now(.*?)for
(' is the \n time ',)


--Darrell

Eric Arnold wrote:

> Does anybody know of any good graphical regex editors out there?
> 
> Eric




More information about the Python-list mailing list