RegEx editors

darrell dgallion1 at yahoo.com
Wed Sep 18 22:31:57 EDT 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