i dont know what regex is, but i guess u are tryin 2 select only the data in within the body tags?! :cool:
Printable View
i dont know what regex is, but i guess u are tryin 2 select only the data in within the body tags?! :cool:
Right. Trying, and still failing. Why won't PHP allow me a character class?!
Mike, help! :(
you had any luck with this twey?
I cant think of any alternative ways of doin this either!
I'm a lot less knowledgable than you guys, but might I suggest that you're working too hard?
It's not like you need to do this more than once.
First... cut/paste what you see, not the code, into a text file, or .htm file... whatever.
Then use that. And you've got it so much easier.
From there, just have it go through character by character, splitting the data at a |. This is what you're doing, but should be a lot easier when it's more in your control.
Now... I'm not sure what a .csv file is, so I don't know if I might be suggesting something that would make it harder to export to that, but I hope not.
Hope this helps.
I haven't, no. :( It's beginning to bug me.Quote:
you had any luck with this twey?
It needs to be kept updated. That's the point.Quote:
It's not like you need to do this more than once.
CSV stands for Comma-Seperated Values. It's a method of storing data, seperated by commas (or, less specifically, any ASCII character; the pipe symbol [|] in this case).Quote:
I'm not sure what a .csv file is
Hmmm... ok. Well.... isn't there an easy way in php to do, basically, cutting and pasting of what you'd see?
And .csv works how? Just out of curiosity... like.. how does it differ from .txt?
Yes. That's what I'm trying to do. :)Quote:
isn't there an easy way in php to do, basically, cutting and pasting of what you'd see?
It doesn't. You're evidently a Windows user -- used to your OS determining how things are treated by their file extension. File extensions are just a convenient method of seeing what type of data the file contains at a glance. They don't have any actual import on the content of the file; for example, I could name an executable .txt, or a text file .so, and it wouldn't actually change the content of the file (although Windows would probably refuse to handle it until I changed it back).Quote:
Just out of curiosity... like.. how does it differ from .txt?
The only difference between a CSV-structured text file and a non-structured text file is how it will be handled. This is the same as the difference between a CSV file and an HTML file, or any two filetypes you'd care to name, in fact.
I'm not on linux, but I'm on a mac and a pc right now... (I do video editing on my mac, and internet and such on my pc.. they're right next to each other).
I know how file extensions work, but I wasn't sure if .csv was a different format in the way that data would be stored within it.
Also... yeah... you can rename files to some extent on macs and it'll still read them. Windows is more touchy. You can also do things like renaming the filetype to get around free webhosts that block filetypes. ^_^
So... yeah... go on. Just curious. got it now, thanks.
Your problem here is a lack of delimiters. The regular expression parser will be treating the first less-than character as a delimiter, and will be looking for a greater-than character to mark the end of the pattern (and the start of the flags).Quote:
Originally Posted by Twey
I'm used to using slashes to delimit patterns, as that's how ECMAScript regular expression literals are formatted.
By the way, I haven't tested this. I only just happened to glance at the thread.PHP Code:preg_match('/<body\b[^>]*>(.*?)<\/body>/', $inc, $s);
Mike
Mike saves the day again. :p