Sunday 30 September 2018

Regular Expression in RPA

In RPA, have you ever been in any situation where you have to deal with some phone no, mail address or web links in between some context and you have to capture that pattern from that context.

Regular expression(RE)  is the best practice for such scenario. RE is a sequence of character that determine the search pattern. This make the task very easy to capture some pattern from any context.

If RPA developer have an idea of Meta Characters then it will make his life very easy.
Some essential patterns.

Mail: [\w.]+@\w+\.(net|com|edu)

Date: (\d{1,2}\/\d{1,2}\/\d{1,4})
pattern like. 21/3/2018

Image: ([^\S]+(?=\.(jpg|gif|png))\.\2)

Phone no: \(?\d{3}[-.)]\d{3}[-.]\d{4}
paterns like.
123-555-4444
123.555.4444
(123)555-4444

weblink: \[.*?\]\(https.*?\)
patterns like.
[Google](https://Google.com)

If you have some other patterns and it's RE then do share in comment.