public class Regex
extends java.lang.Object
PTransforms to use Regular Expressions to process elements in a PCollection.
 matches(String, int) can be used to see if an entire line matches a Regex.
 matchesKV(String, int, int) can be used to see if an entire line matches a Regex
 and output certain groups as a KV.
 
find(String, int) can be used to see if a portion of a line matches a Regex.
 matchesKV(String, int, int) can be used to see if a portion of a line matches a
 Regex and output certain groups as a KV.
 
Lines that do not match the Regex will not be output.
| Modifier and Type | Class and Description | 
|---|---|
| static class  | Regex.AllMatchesRegex.MatchesName<String>takes aPCollection<String>and returns aPCollection<List<String>>representing the value extracted from all the Regex groups of the
 inputPCollectionto the number of times that element occurs in the input. | 
| static class  | Regex.FindRegex.Find<String>takes aPCollection<String>and returns aPCollection<String>representing the value extracted from the Regex groups of the inputPCollectionto the number of times that element occurs in the input. | 
| static class  | Regex.FindAllRegex.Find<String>takes aPCollection<String>and returns aPCollection<List<String>>representing the value extracted from the Regex groups of the inputPCollectionto the number of times that element occurs in the input. | 
| static class  | Regex.FindKVRegex.MatchesKV<KV<String, String>>takes aPCollection<String>and returns aPCollection<KV<String, String>>representing the key and value extracted from the Regex
 groups of the inputPCollectionto the number of times that element occurs in the
 input. | 
| static class  | Regex.FindNameRegex.Find<String>takes aPCollection<String>and returns aPCollection<String>representing the value extracted from the Regex groups of the inputPCollectionto the number of times that element occurs in the input. | 
| static class  | Regex.FindNameKVRegex.MatchesKV<KV<String, String>>takes aPCollection<String>and returns aPCollection<KV<String, String>>representing the key and value extracted from the Regex
 groups of the inputPCollectionto the number of times that element occurs in the
 input. | 
| static class  | Regex.MatchesRegex.Matches<String>takes aPCollection<String>and returns aPCollection<String>representing the value extracted from the Regex groups of the inputPCollectionto the number of times that element occurs in the input. | 
| static class  | Regex.MatchesKVRegex.MatchesKV<KV<String, String>>takes aPCollection<String>and returns aPCollection<KV<String, String>>representing the key and value extracted from the Regex
 groups of the inputPCollectionto the number of times that element occurs in the
 input. | 
| static class  | Regex.MatchesNameRegex.MatchesName<String>takes aPCollection<String>and returns aPCollection<String>representing the value extracted from the Regex groups of the inputPCollectionto the number of times that element occurs in the input. | 
| static class  | Regex.MatchesNameKVRegex.MatchesNameKV<KV<String, String>>takes aPCollection<String>and returns
 aPCollection<KV<String, String>>representing the key and value extracted from the
 Regex groups of the inputPCollectionto the number of times that element occurs in the
 input. | 
| static class  | Regex.ReplaceAllRegex.ReplaceAll<String>takes aPCollection<String>and returns aPCollection<String>with all Strings that matched the Regex being replaced with the
 replacement string. | 
| static class  | Regex.ReplaceFirstRegex.ReplaceFirst<String>takes aPCollection<String>and returns aPCollection<String>with the first Strings that matched the Regex being replaced with the
 replacement string. | 
| static class  | Regex.SplitRegex.Split<String>takes aPCollection<String>and returns aPCollection<String>with the input string split into individual items in a list. | 
| Modifier and Type | Method and Description | 
|---|---|
| static Regex.AllMatches | allMatches(java.util.regex.Pattern pattern)Returns a  Regex.AllMatchesPTransformthat checks if the entire line matches
 the Regex. | 
| static Regex.AllMatches | allMatches(java.lang.String regex)Returns a  Regex.AllMatchesPTransformthat checks if the entire line matches
 the Regex. | 
| static Regex.Find | find(java.util.regex.Pattern pattern)Returns a  Regex.FindPTransformthat checks if a portion of the line matches
 the Regex. | 
| static Regex.Find | find(java.util.regex.Pattern pattern,
    int group)Returns a  Regex.FindPTransformthat checks if a portion of the line matches
 the Regex. | 
| static Regex.FindName | find(java.util.regex.Pattern pattern,
    java.lang.String groupName)Returns a  Regex.FindNamePTransformthat checks if a portion of the line
 matches the Regex. | 
| static Regex.Find | find(java.lang.String regex)Returns a  Regex.FindPTransformthat checks if a portion of the line matches
 the Regex. | 
| static Regex.Find | find(java.lang.String regex,
    int group)Returns a  Regex.FindPTransformthat checks if a portion of the line matches
 the Regex. | 
| static Regex.FindName | find(java.lang.String regex,
    java.lang.String groupName)Returns a  Regex.FindNamePTransformthat checks if a portion of the line
 matches the Regex. | 
| static Regex.FindAll | findAll(java.util.regex.Pattern pattern)Returns a  Regex.FindAllPTransformthat checks if a portion of the line matches
 the Regex. | 
| static Regex.FindAll | findAll(java.lang.String regex)Returns a  Regex.FindAllPTransformthat checks if a portion of the line matches
 the Regex. | 
| static Regex.FindKV | findKV(java.util.regex.Pattern pattern,
      int keyGroup,
      int valueGroup)Returns a  Regex.FindKVPTransformthat checks if a portion of the line matches
 the Regex. | 
| static Regex.FindNameKV | findKV(java.util.regex.Pattern pattern,
      java.lang.String keyGroupName,
      java.lang.String valueGroupName)Returns a  Regex.FindNameKVPTransformthat checks if a portion of the line
 matches the Regex. | 
| static Regex.FindKV | findKV(java.lang.String regex,
      int keyGroup,
      int valueGroup)Returns a  Regex.FindKVPTransformthat checks if a portion of the line matches
 the Regex. | 
| static Regex.FindNameKV | findKV(java.lang.String regex,
      java.lang.String keyGroupName,
      java.lang.String valueGroupName)Returns a  Regex.FindNameKVPTransformthat checks if a portion of the line
 matches the Regex. | 
| static Regex.Matches | matches(java.util.regex.Pattern pattern)Returns a  Regex.MatchesPTransformthat checks if the entire line matches the
 Regex. | 
| static Regex.Matches | matches(java.util.regex.Pattern pattern,
       int group)Returns a  Regex.MatchesPTransformthat checks if the entire line matches the
 Regex. | 
| static Regex.MatchesName | matches(java.util.regex.Pattern pattern,
       java.lang.String groupName)Returns a  Regex.MatchesNamePTransformthat checks if the entire line matches
 the Regex. | 
| static Regex.Matches | matches(java.lang.String regex)Returns a  Regex.MatchesPTransformthat checks if the entire line matches the
 Regex. | 
| static Regex.Matches | matches(java.lang.String regex,
       int group)Returns a  Regex.MatchesPTransformthat checks if the entire line matches the
 Regex. | 
| static Regex.MatchesName | matches(java.lang.String regex,
       java.lang.String groupName)Returns a  Regex.MatchesNamePTransformthat checks if the entire line matches
 the Regex. | 
| static Regex.MatchesKV | matchesKV(java.util.regex.Pattern pattern,
         int keyGroup,
         int valueGroup)Returns a  Regex.MatchesKVPTransformthat checks if the entire line matches the
 Regex. | 
| static Regex.MatchesNameKV | matchesKV(java.util.regex.Pattern pattern,
         java.lang.String keyGroupName,
         java.lang.String valueGroupName)Returns a  Regex.MatchesNameKVPTransformthat checks if the entire line matches
 the Regex. | 
| static Regex.MatchesKV | matchesKV(java.lang.String regex,
         int keyGroup,
         int valueGroup)Returns a  Regex.MatchesKVPTransformthat checks if the entire line matches the
 Regex. | 
| static Regex.MatchesNameKV | matchesKV(java.lang.String regex,
         java.lang.String keyGroupName,
         java.lang.String valueGroupName)Returns a  Regex.MatchesNameKVPTransformthat checks if the entire line matches
 the Regex. | 
| static Regex.ReplaceAll | replaceAll(java.util.regex.Pattern pattern,
          java.lang.String replacement)Returns a  Regex.ReplaceAllPTransformthat checks if a portion of the line
 matches the Regex and replaces all matches with the replacement String. | 
| static Regex.ReplaceAll | replaceAll(java.lang.String regex,
          java.lang.String replacement)Returns a  Regex.ReplaceAllPTransformthat checks if a portion of the line
 matches the Regex and replaces all matches with the replacement String. | 
| static Regex.ReplaceFirst | replaceFirst(java.util.regex.Pattern pattern,
            java.lang.String replacement)Returns a  Regex.ReplaceAllPTransformthat checks if a portion of the line
 matches the Regex and replaces the first match with the replacement String. | 
| static Regex.ReplaceFirst | replaceFirst(java.lang.String regex,
            java.lang.String replacement)Returns a  Regex.ReplaceAllPTransformthat checks if a portion of the line
 matches the Regex and replaces the first match with the replacement String. | 
| static Regex.Split | split(java.util.regex.Pattern pattern)Returns a  Regex.SplitPTransformthat splits a string on the regular expression
 and then outputs each item. | 
| static Regex.Split | split(java.util.regex.Pattern pattern,
     boolean outputEmpty)Returns a  Regex.SplitPTransformthat splits a string on the regular expression
 and then outputs each item. | 
| static Regex.Split | split(java.lang.String regex)Returns a  Regex.SplitPTransformthat splits a string on the regular expression
 and then outputs each item. | 
| static Regex.Split | split(java.lang.String regex,
     boolean outputEmpty)Returns a  Regex.SplitPTransformthat splits a string on the regular expression
 and then outputs each item. | 
public static Regex.Matches matches(java.lang.String regex)
Regex.Matches PTransform that checks if the entire line matches the
 Regex. Returns the entire line (group 0) as a PCollection.regex - The regular expression to runpublic static Regex.Matches matches(java.util.regex.Pattern pattern)
Regex.Matches PTransform that checks if the entire line matches the
 Regex. Returns the entire line (group 0) as a PCollection.pattern - The regular expression to runpublic static Regex.Matches matches(java.lang.String regex, int group)
Regex.Matches PTransform that checks if the entire line matches the
 Regex. Returns the group as a PCollection.regex - The regular expression to rungroup - The Regex group to return as a PCollectionpublic static Regex.Matches matches(java.util.regex.Pattern pattern, int group)
Regex.Matches PTransform that checks if the entire line matches the
 Regex. Returns the group as a PCollection.pattern - The regular expression to rungroup - The Regex group to return as a PCollectionpublic static Regex.MatchesName matches(java.lang.String regex, java.lang.String groupName)
Regex.MatchesName PTransform that checks if the entire line matches
 the Regex. Returns the group as a PCollection.regex - The regular expression to rungroupName - The Regex group name to return as a PCollectionpublic static Regex.MatchesName matches(java.util.regex.Pattern pattern, java.lang.String groupName)
Regex.MatchesName PTransform that checks if the entire line matches
 the Regex. Returns the group as a PCollection.pattern - The regular expression to rungroupName - The Regex group name to return as a PCollectionpublic static Regex.AllMatches allMatches(java.lang.String regex)
Regex.AllMatches PTransform that checks if the entire line matches
 the Regex. Returns all groups as a List<String> in a PCollection.regex - The regular expression to runpublic static Regex.AllMatches allMatches(java.util.regex.Pattern pattern)
Regex.AllMatches PTransform that checks if the entire line matches
 the Regex. Returns all groups as a List<String> in a PCollection.pattern - The regular expression to runpublic static Regex.MatchesKV matchesKV(java.lang.String regex, int keyGroup, int valueGroup)
Regex.MatchesKV PTransform that checks if the entire line matches the
 Regex. Returns the specified groups as the key and value as a PCollection.regex - The regular expression to runkeyGroup - The Regex group to use as the keyvalueGroup - The Regex group to use the valuepublic static Regex.MatchesKV matchesKV(java.util.regex.Pattern pattern, int keyGroup, int valueGroup)
Regex.MatchesKV PTransform that checks if the entire line matches the
 Regex. Returns the specified groups as the key and value as a PCollection.pattern - The regular expression to runkeyGroup - The Regex group to use as the keyvalueGroup - The Regex group to use the valuepublic static Regex.MatchesNameKV matchesKV(java.lang.String regex, java.lang.String keyGroupName, java.lang.String valueGroupName)
Regex.MatchesNameKV PTransform that checks if the entire line matches
 the Regex. Returns the specified groups as the key and value as a PCollection.regex - The regular expression to runkeyGroupName - The Regex group name to use as the keyvalueGroupName - The Regex group name to use the valuepublic static Regex.MatchesNameKV matchesKV(java.util.regex.Pattern pattern, java.lang.String keyGroupName, java.lang.String valueGroupName)
Regex.MatchesNameKV PTransform that checks if the entire line matches
 the Regex. Returns the specified groups as the key and value as a PCollection.pattern - The regular expression to runkeyGroupName - The Regex group name to use as the keyvalueGroupName - The Regex group name to use the valuepublic static Regex.Find find(java.lang.String regex)
Regex.Find PTransform that checks if a portion of the line matches
 the Regex. Returns the entire line (group 0) as a PCollection.regex - The regular expression to runpublic static Regex.Find find(java.util.regex.Pattern pattern)
Regex.Find PTransform that checks if a portion of the line matches
 the Regex. Returns the entire line (group 0) as a PCollection.pattern - The regular expression to runpublic static Regex.Find find(java.lang.String regex, int group)
Regex.Find PTransform that checks if a portion of the line matches
 the Regex. Returns the group as a PCollection.regex - The regular expression to rungroup - The Regex group to return as a PCollectionpublic static Regex.Find find(java.util.regex.Pattern pattern, int group)
Regex.Find PTransform that checks if a portion of the line matches
 the Regex. Returns the group as a PCollection.pattern - The regular expression to rungroup - The Regex group to return as a PCollectionpublic static Regex.FindName find(java.lang.String regex, java.lang.String groupName)
Regex.FindName PTransform that checks if a portion of the line
 matches the Regex. Returns the group as a PCollection.regex - The regular expression to rungroupName - The Regex group name to return as a PCollectionpublic static Regex.FindName find(java.util.regex.Pattern pattern, java.lang.String groupName)
Regex.FindName PTransform that checks if a portion of the line
 matches the Regex. Returns the group as a PCollection.pattern - The regular expression to rungroupName - The Regex group name to return as a PCollectionpublic static Regex.FindAll findAll(java.lang.String regex)
Regex.FindAll PTransform that checks if a portion of the line matches
 the Regex. Returns all the groups as a List<String> in a PCollection.regex - The regular expression to runpublic static Regex.FindAll findAll(java.util.regex.Pattern pattern)
Regex.FindAll PTransform that checks if a portion of the line matches
 the Regex. Returns all the groups as a List<String> in a PCollection.pattern - The regular expression to runpublic static Regex.FindKV findKV(java.lang.String regex, int keyGroup, int valueGroup)
Regex.FindKV PTransform that checks if a portion of the line matches
 the Regex. Returns the specified groups as the key and value as a PCollection.regex - The regular expression to runkeyGroup - The Regex group to use as the keyvalueGroup - The Regex group to use the valuepublic static Regex.FindKV findKV(java.util.regex.Pattern pattern, int keyGroup, int valueGroup)
Regex.FindKV PTransform that checks if a portion of the line matches
 the Regex. Returns the specified groups as the key and value as a PCollection.pattern - The regular expression to runkeyGroup - The Regex group to use as the keyvalueGroup - The Regex group to use the valuepublic static Regex.FindNameKV findKV(java.lang.String regex, java.lang.String keyGroupName, java.lang.String valueGroupName)
Regex.FindNameKV PTransform that checks if a portion of the line
 matches the Regex. Returns the specified groups as the key and value as a PCollection.regex - The regular expression to runkeyGroupName - The Regex group name to use as the keyvalueGroupName - The Regex group name to use the valuepublic static Regex.FindNameKV findKV(java.util.regex.Pattern pattern, java.lang.String keyGroupName, java.lang.String valueGroupName)
Regex.FindNameKV PTransform that checks if a portion of the line
 matches the Regex. Returns the specified groups as the key and value as a PCollection.pattern - The regular expression to runkeyGroupName - The Regex group name to use as the keyvalueGroupName - The Regex group name to use the valuepublic static Regex.ReplaceAll replaceAll(java.lang.String regex, java.lang.String replacement)
Regex.ReplaceAll PTransform that checks if a portion of the line
 matches the Regex and replaces all matches with the replacement String. Returns the group as a
 PCollection.regex - The regular expression to runreplacement - The string to be substituted for each matchpublic static Regex.ReplaceAll replaceAll(java.util.regex.Pattern pattern, java.lang.String replacement)
Regex.ReplaceAll PTransform that checks if a portion of the line
 matches the Regex and replaces all matches with the replacement String. Returns the group as a
 PCollection.pattern - The regular expression to runreplacement - The string to be substituted for each matchpublic static Regex.ReplaceFirst replaceFirst(java.lang.String regex, java.lang.String replacement)
Regex.ReplaceAll PTransform that checks if a portion of the line
 matches the Regex and replaces the first match with the replacement String. Returns the group
 as a PCollection.regex - The regular expression to runreplacement - The string to be substituted for each matchpublic static Regex.ReplaceFirst replaceFirst(java.util.regex.Pattern pattern, java.lang.String replacement)
Regex.ReplaceAll PTransform that checks if a portion of the line
 matches the Regex and replaces the first match with the replacement String. Returns the group
 as a PCollection.pattern - The regular expression to runreplacement - The string to be substituted for each matchpublic static Regex.Split split(java.lang.String regex)
Regex.Split PTransform that splits a string on the regular expression
 and then outputs each item. It will not output empty items. Returns the group as a PCollection. a PCollection.regex - The regular expression to runpublic static Regex.Split split(java.util.regex.Pattern pattern)
Regex.Split PTransform that splits a string on the regular expression
 and then outputs each item. It will not output empty items. Returns the group as a PCollection. a PCollection.pattern - The regular expression to runpublic static Regex.Split split(java.lang.String regex, boolean outputEmpty)
Regex.Split PTransform that splits a string on the regular expression
 and then outputs each item. Returns the group as a PCollection.regex - The regular expression to runoutputEmpty - Should empty be output. True to output empties and false if not.public static Regex.Split split(java.util.regex.Pattern pattern, boolean outputEmpty)
Regex.Split PTransform that splits a string on the regular expression
 and then outputs each item. Returns the group as a PCollection.pattern - The regular expression to runoutputEmpty - Should empty be output. True to output empties and false if not.