limit « matcher « 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 » matcher » limit 

1. in matcher.replace method,how to limit replace times?    stackoverflow.com

in matcher.replace method,only has: replaceFirst() and replaceAll() two methods i want limit replace 3 times,how to do? example:

String content="aaaaaaaaaa";
i want to get result is: "bbbaaaaaaa" my code:
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class T1 {
    ...

2. Java : does regex pattern matcher have a size limit?    stackoverflow.com

My pattern is OR-like : "word1|word2|word3" I have approximately 800 words. Can it be a problem ?

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.