regex - What is the Java 1.4.2 equivalent of Pattern.quote() -
What would be the pattern 1.4.2 equivalent pattern? questions?
I was using patterns to bid on URI () but now it needs to make 1.4.2 compatible.
The good code of pattern.quote
is available and looks like this :
public fixed string bidding (strings) {int slash eindex = s.indexOf ("\\ E"); If (slashEIndex == -1) returns "\\ Q" + s + "\\ E"; Stringbilder sb = new string builder (s.length () * 2); Sb.append ("\\ cue"); SlashEIndex = 0; int current = 0; while ((slashEIndex = s.indexOf ("\\ E", current)) -1 = {sb.append (s.sstring) (Current, slashEIndex)); current = slashindx + 2; sb.append ("\\ e \\\\ e \\ Q '); } Sb.append (s.sststring (current, s.length ())); Sb.append ("\\ e"); Return sb.toString (); }
Actually it depends on
\ Q, nothing, but not all quotes of \ E \ E are quoted, but The quote ends \ Q
and there is a special type of case that is present in the \ E
string.
Comments
Post a Comment