Icon

Complex Regex Split

In real life the data we get is not always uniform. Some rows may contain x, y, z, while others only contain x and y or some other combination. In Regex, we can specify elementsthat may exist using a ?For instance, in the Regex Split node we can use (a)(b)?(c)? to capture abc, ab, ac, etc. as separate captured groups. The English translation of this regex is: Find a (it will exist),find b (if may not exist), find c (it may not exist).Look at the real-life example and see if you can split a row like NIB - Our Accounts OTHERS SG0900041 ##SM-SPOREInto 4 parts:NIB - Our AccountsOTHERSSG0900041##SM-SPOREBeware as not all 4 parts are found in each row and the 2nd group may require a more manual approach. Simple Example(a)(b)?(c)?Real Life Example(.*)(BRANCHES|HO|MERCHANT BANK|OTHERS|SUBSIDIARY-BANK|SUBSIDIARY-NON BANK)(\s[A-Z]{2}[0-9]+)?(.*)?Table Creator Regex Split Table Creator Regex Split In real life the data we get is not always uniform. Some rows may contain x, y, z, while others only contain x and y or some other combination. In Regex, we can specify elementsthat may exist using a ?For instance, in the Regex Split node we can use (a)(b)?(c)? to capture abc, ab, ac, etc. as separate captured groups. The English translation of this regex is: Find a (it will exist),find b (if may not exist), find c (it may not exist).Look at the real-life example and see if you can split a row like NIB - Our Accounts OTHERS SG0900041 ##SM-SPOREInto 4 parts:NIB - Our AccountsOTHERSSG0900041##SM-SPOREBeware as not all 4 parts are found in each row and the 2nd group may require a more manual approach. Simple Example(a)(b)?(c)?Real Life Example(.*)(BRANCHES|HO|MERCHANT BANK|OTHERS|SUBSIDIARY-BANK|SUBSIDIARY-NON BANK)(\s[A-Z]{2}[0-9]+)?(.*)?Table Creator Regex Split Table Creator Regex Split

Nodes

Extensions

Links