| Start |
|---|
| Matching strings The
Regular expressions attempt to match the default variable ( You can also use different delimiters is you precede the regular expression with the This is useful when matching strings that include the |
Replace a string using regular expressions |
Usage of \Q and \E in pattern matching What's between \Q and \E is treated as normal characters} Output |
| Parsing a string with a regex Generally, it's not a good idea to use a regular expression to parse a complex structure (opens new window). But it can be done. For instance, you might want to load data into hive table and fields are separated by comma but complex types like array are separated by a "|". Files contain records with all fields separated by comma and complex type are inside square bracket. In that case, this bit of disposable Perl might be sufficient: You'll want to spot check the output: 1,2,[3|4|5],5,6,[7|8],[1|2|34],5 |
Read Article
https://develop.horje.com/learn/1434/reference