D
David Bear
I'm trying to understand how regex's are interpreted out of strings
objects. for example, If I have a string that has newline chars in
it, how can I get a re.split to respect where the newlines are?
I want to split the string bs. a '^in' should have also match \nin
where \n is the newline char.
Ultimately I have a large string buffer that I want to split at each
occurence of a particular regular expression, where the result
contains everything from the occurence of the regex till the end of
the 'line'
any pointers?
David Bear
phone: 480-965-8257
fax: 480-965-9189
College of Public Programs/ASU
Wilson Hall 232
Tempe, AZ 85287-0803
"Beware the IP portfolio, everyone will be suspect of trespassing"
objects. for example, If I have a string that has newline chars in
it, how can I get a re.split to respect where the newlines are?
bs = 'in the begining, \n there were new lines, and in the end \nin lines'
re.split('^in', bs) ['', ' the begining, \n there were new lines, and in the end \nin lines']
I want to split the string bs. a '^in' should have also match \nin
where \n is the newline char.
Ultimately I have a large string buffer that I want to split at each
occurence of a particular regular expression, where the result
contains everything from the occurence of the regex till the end of
the 'line'
any pointers?
David Bear
phone: 480-965-8257
fax: 480-965-9189
College of Public Programs/ASU
Wilson Hall 232
Tempe, AZ 85287-0803
"Beware the IP portfolio, everyone will be suspect of trespassing"