On Fri, 30 Jan 2004 16:13:43 -0800, Christopher M. Lusardi wrote:
> How do I split a string using the library function "split" with an asterisk?
> I have to tell split break the string when it sees "abc*". I.E.: If I give split
> the string "abc def ghi jkl abc* message" I want to get back two parts.
> I want "abc def ghi jkl" and "message".
After reading some of the responses and re-reading this post again, I have
to ask ....
What *exactly* are you trying to do? It almost seems like an XY problem.
I say this becasue the last line your your post almost reads like ... you
want to parse a log file ("date ... message" versus "abc efg ... message"
- they *look* similar).
If you're trying to parse a *NIX log file, you could use a module to do
this and make life easier for yourself. Or, you could use 'unpack', which
may work better for you instead of 'split'.
HTH
--
Jim
Copyright notice: all code written by the author in this post is
released under the GPL.
http://www.gnu.org/licenses/gpl.txt
for more information.
a fortune quote ...
Peace, n.: In international affairs, a period of cheating
<between two periods of fighting. -- Ambrose Bierce, "The
Devil's Dictionary"