railo.runtime.regex
Class Perl5Util

java.lang.Object
  extended by railo.runtime.regex.Perl5Util

public final class Perl5Util
extends Object


Constructor Summary
Perl5Util()
           
 
Method Summary
static Struct find(String strPattern, String strInput, int offset, boolean caseSensitive)
          find occurence of a pattern in a string (same like indexOf), but dont return first ocurence , it return struct with all information
static int indexOf(String strPattern, String strInput, int offset, boolean caseSensitive)
          return index of the first occurence of the pattern in input text
static void main(String[] args)
           
static Array match(String strPattern, String strInput, int offset, boolean caseSensitive)
           
static String replace(String strInput, String strPattern, String replacement, boolean caseSensitive, boolean replaceAll)
          replace the first/all occurence of given pattern
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Perl5Util

public Perl5Util()
Method Detail

indexOf

public static int indexOf(String strPattern,
                          String strInput,
                          int offset,
                          boolean caseSensitive)
                   throws org.apache.oro.text.regex.MalformedPatternException
return index of the first occurence of the pattern in input text

Parameters:
strPattern - pattern to search
strInput - text to search pattern
offset -
caseSensitive -
Returns:
position of the first occurence
Throws:
org.apache.oro.text.regex.MalformedPatternException

find

public static Struct find(String strPattern,
                          String strInput,
                          int offset,
                          boolean caseSensitive)
                   throws org.apache.oro.text.regex.MalformedPatternException
find occurence of a pattern in a string (same like indexOf), but dont return first ocurence , it return struct with all information

Parameters:
strPattern -
strInput -
offset -
caseSensitive -
Returns:
Throws:
org.apache.oro.text.regex.MalformedPatternException

match

public static Array match(String strPattern,
                          String strInput,
                          int offset,
                          boolean caseSensitive)
                   throws org.apache.oro.text.regex.MalformedPatternException
Throws:
org.apache.oro.text.regex.MalformedPatternException

replace

public static String replace(String strInput,
                             String strPattern,
                             String replacement,
                             boolean caseSensitive,
                             boolean replaceAll)
                      throws org.apache.oro.text.regex.MalformedPatternException
replace the first/all occurence of given pattern

Parameters:
strInput - text to search pattern
strPattern - pattern to search
replacement - text to replace with pattern
caseSensitive -
replaceAll - do replace all or only one
Returns:
transformed text
Throws:
org.apache.oro.text.regex.MalformedPatternException

main

public static void main(String[] args)
                 throws org.apache.oro.text.regex.MalformedPatternException
Throws:
org.apache.oro.text.regex.MalformedPatternException


Copyright © 2012 Railo