English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

I have to extract information from a line of text (no escape characters). However, I want to extract all the way until the next data type, as I do not know for sure the way the information will be presented.

Here is a sample line:

(R) MCCRACKEN ROYAL "MAC" 20 99 8 8

extracted:
1. Extract info inside ( ).
2. letters,punctuation
3. number
4. number
5. number
6. number

Please help!

2006-10-30 11:28:29 · 1 answers · asked by njwhalen25 1 in Computers & Internet Programming & Design

1 answers

maybe something like this:

$eregi="((.*)) (.*) (.*) (.*) (.*) (.*)";
eregi($eregi, $line, $result);

actually i don't think that will work cause it won't be able to tell when the string ends, but maybe this can give something to work with. If there is some way you can mark the begining and end of the string you could use that.

2006-10-30 12:44:41 · answer #1 · answered by Brady 3 · 0 0

fedest.com, questions and answers