Click here to Skip to main content
15,888,106 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Goal:
If the data inside of the "(" + ")" contains data that is alphabet and included brackets, then it is true.

However if it contain data that is any number, included brackets, then it will be false.


Problem:
I don't know how to solve it in relation to including brackets.

http://regexr.com/3d0dh
By reviewing the code, the selection does not include the brackets

Thank you!


C#
sdf (ff)
answer: true

dddd (335g) ddd
answer: false

sdf(f344f) 21ff
answer: false

sdf(dd) 433dd
answer: true


What I have tried:

I have coded the regex code and I also have made some research but unfortunatly I still cannot find the answer or part of the answer.
Posted
Updated 13-Mar-16 15:50pm
Comments
Garth J Lancaster 13-Mar-16 20:25pm    
you havnt posted any relevant code - what expression(s) are you using for example ? in general, you would include brackets in your regular expression by escaping them - eg

"\(\w*\)"

would match any word character [A-Za-z0-9_] zero or more times and include brackets ... there's a nice regex cheat-sheet here http://www.mikesdotnetting.com/article/46/c-regular-expressions-cheat-sheet and there are also tools online to test regexes http://regexstorm.net/tester for one example

1 solution

Try this:
\([a-zA-Z]+\)

Learn: The 30 Minute Regex Tutorial[^]
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900