14 April 2014

Regex for Matching Values


Regex to match the following string :

Pattern 1:


Regex Expression:
 \(\w+\)

String:
Bangladesh (Dhaka)

Result/Output Matching Result:
(Dhaka)

Pattern 2:


Regex Expression:
\w+.\w+.*\(

String:
Apple (Fruit)

Result/ Matched output:
Apple (



(If you found this article useful then share with your friends.)

No comments: