href « parse « Java Regex Q&A

Home
Java Regex Q&A
1.Development
2.find
3.group
4.Match
5.matcher
6.number
7.Operation
8.parse
9.Pattern
10.replace
11.validation
12.word
Java Regex Q&A » parse » href 

1. Parse html (a href) using regex    forums.oracle.com

2. regex help: parsing href and .mp3    forums.oracle.com

Short answer: too many forward-slashes, not enough backslashes. PHP takes Perl-style regex literals, which use '/' as their (default) delimiter, and reproduces them inside PHP string literals. It also retains the Perl-style modifiers, meaning the 'i', 's', 'm', etc., following the closing delimiter. In Java, you drop the regex-specific delimiters, and replace the modifiers with symbolic constants like Pattern.CASE_INSENSITIVE, which are ...

java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.