Perl regex vs substring?

La Dee Da

New member
If i have the following:

<tag> text here </tag>

and I just want to get the text in between the tags, is it better to use regex or substring?
can't use any packages of any sort for this assignment.

Thanks.
I've been using regex but ran into a problem.

if i have:

<tag>first line of text
text
text</tag>

Is there a way, using regex to just get whatever text is after <tag>? Like in this case, have it return just "first line of text" ?
i guess i should add that i'm reading a file line by line.
 
Back
Top