You are viewing a plain text version of this content. The canonical link for it is here.
Posted to regexp-user@jakarta.apache.org by Juan Uys <ju...@fm.ly> on 2003/07/23 16:18:24 UTC
newbie regexp - finding content
Hi there, this is my first post.
My current assignment is to pull a complete website (35KB), and to
format it so that it's email-compliant with the various flavours of
clients out there.
So, naturally the first thing I'd like to remove is
<script>stuff</script> - be it on one line, or spread over multiple.
I've tried the following catch-all, and it works for one-liners, but not
the tags over multiple lines:
RE reg = new
RE(beginDelim+"[\\n]*[:alnum:]*[:alpha:]*[:blank:]*[:cntrl:]*[:digit:]*[:graph:]*[:lower:]*[:print:]*[:punct:]*[:space:]*[:upper:]*[:xdigit:]*"+endDelim, RE.MATCH_MULTILINE);
where beginDelim = "<script" and endDelim = "</script>"
I thought that the RE.MATCH_MULTILINE or even the [\\n]* or [:space:]
might cover multiple lines.
Thanks in advance!
Juan
---------------------------------------------------------------------
To unsubscribe, e-mail: regexp-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: regexp-user-help@jakarta.apache.org
Re: newbie regexp - finding content
Posted by Juan Uys <ju...@fm.ly>.
" . Matches any character other than newline"
taken from:
http://jakarta.apache.org/regexp/apidocs/
I've opted for the ORO perl utilities instead.
Thanks for the feedback, Schamil
On Wed, 2003-07-23 at 17:16, Schamil Wackenhut wrote:
> * Juan Uys meinte:
>
> > I don't think '.' includes newline.
>
> How about reading the documentation? Hint: UNIX_LINES or DOTALL
---------------------------------------------------------------------
To unsubscribe, e-mail: regexp-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: regexp-user-help@jakarta.apache.org
Re: newbie regexp - finding content
Posted by Schamil Wackenhut <sw...@wacke.org>.
* Juan Uys meinte:
> I don't think '.' includes newline.
How about reading the documentation? Hint: UNIX_LINES or DOTALL
--
/earth: file system full.
---------------------------------------------------------------------
To unsubscribe, e-mail: regexp-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: regexp-user-help@jakarta.apache.org
Re: newbie regexp - finding content
Posted by Juan Uys <ju...@fm.ly>.
I don't think '.' includes newline.
On Wed, 2003-07-23 at 16:33, Schamil Wackenhut wrote:
> * Juan Uys meinte:
>
> > I thought that the RE.MATCH_MULTILINE or even the [\\n]* or [:space:]
> > might cover multiple lines.
>
> What about dot?
---------------------------------------------------------------------
To unsubscribe, e-mail: regexp-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: regexp-user-help@jakarta.apache.org
Re: newbie regexp - finding content
Posted by Schamil Wackenhut <sw...@wacke.org>.
* Juan Uys meinte:
> I thought that the RE.MATCH_MULTILINE or even the [\\n]* or [:space:]
> might cover multiple lines.
What about dot?
--
/earth: file system full.
---------------------------------------------------------------------
To unsubscribe, e-mail: regexp-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: regexp-user-help@jakarta.apache.org