What is the use of Regular Expressions?

Can anyone please explain me why we will use this statement
System.Text.RegularExpressions.Regex.Matches(row(“ColumnName”).ToString.Trim,"^[A-z]+|[A-z]+")(0).ToString+" "+System.Text.RegularExpressions.Regex.Matches(row("ColumnName").ToString.Trim,"^[A-z]+|[A-z]+")(1).ToString

@Kavyasri

This is to match only A-z Characters only, not any Number or Special characters in the given text / string

Check as below

image

As Matches will give list of Matches, so (0), (1) means to pick 1st result and 1 to pick 2nd result

Mark as solution if this helps

Thanks

2 Likes

Okay…Thanks for the reply
Does it helps to delete the middle text in the excel cell
For example…


In this shall I delete the “Cross Shell” in “Ont Cross Shell Mumbai” and "The tree"in “Nest In The tree Hydd”, Likewise I want to delete middle text in all the cells present in the Address column
(upload://wkI7HjqMNyIWZoZRDeiED0ym3aR.png)

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.