Skip to main content

a question about using regular expression

1 reply [Last post]
jtqiu
Offline
Joined: 2007-11-17
Points: 0

Hi,
This is a part of HTML file.
SPAN A href=… how /A /SPAN
SPAN A href=… are/A /SPAN
SPAN A href=… you /A /SPAN

SPAN /SPAN A and /A are tags, i omit angel brackets intentionally

I want to use regular expression to extract content between two tags SPAN and /SPAN
What should the regular expressin and code be?

Message was edited by: jtqiu

Message was edited by: jtqiu

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
tarbo
Offline
Joined: 2006-12-18
Points: 0

[url=http://java.sun.com/javase/6/docs/api/java/util/regex/Pattern.html]java.util.regex.Pattern[/url] will help you nicely here. Additionally, [url=http://java.sun.com/javase/6/docs/api/java/util/Scanner.html]java.util.Scanner[/url] may alleviate I/O drudgery you encounter.