Help With Regular Expressions
Posted: Fri May 25, 2007 12:53 pm
I'm trying to find a way to extract a specific area of a string. say i have this in a file:
[begin file]
**start
here is some text
...more of the same text
still more of the same text.
**end
**startagain
here is some different text
...more of the same text
still more of the same text.
**end
[/file]
now what i want to do is read that file, and get what is in between the first "**start" and "**end", and then maybe i want to read the file a different time and extract the text between "**startagain" and "**end". basically i'm looking for a function that takes a string and two pointers, and gives you back what is in between the two pointers. does that make sense? if anyone knows a function for this or a good work-around, that would be great. I don't have much experience with reading files and slicing them up.
thanks in advance!
[begin file]
**start
here is some text
...more of the same text
still more of the same text.
**end
**startagain
here is some different text
...more of the same text
still more of the same text.
**end
[/file]
now what i want to do is read that file, and get what is in between the first "**start" and "**end", and then maybe i want to read the file a different time and extract the text between "**startagain" and "**end". basically i'm looking for a function that takes a string and two pointers, and gives you back what is in between the two pointers. does that make sense? if anyone knows a function for this or a good work-around, that would be great. I don't have much experience with reading files and slicing them up.
thanks in advance!