Click here to Skip to main content
15,881,172 members
Please Sign up or sign in to vote.
1.50/5 (4 votes)
Hi friends,

I need to change the following strings in C# using regular expressions.

1) ntext(1073741823) to simply TEXT
2) DEFAULT((0)) to DEFAULT '0'

Please help me with the regular expressions.

Regards,
sarva
Posted
Updated 30-Sep-12 6:16am
v2
Comments
joshrduncan2012 27-Sep-12 9:07am    
Have you tried something already and stuck in a certain spot? If so, can you provide your code where you are stuck?
Ashraff Ali Wahab 27-Sep-12 9:10am    
Is there any specific logic behind converting the string or just ntext(1212121212) to text means you can simply do substring.
sjelen 27-Sep-12 9:26am    
Install Expresso and play around with regexes, it's not that hard to learn.
Soon it will be quicker for you to write your own regex than to post a question here
Yvan Rodrigues 30-Sep-12 12:18pm    
I agree. I always let intern programmars know that regular expressions are like a secret society. Those that truly understand them will have super powers.
Sarrrva 1-Oct-12 5:32am    
i agree with yoy yvan!!!

regards
sarva

1 solution

Replace ntext\(\d+\) with TEXT

Replace DEFAULT\(\((\d+)\)\) with DEFAULT '$1'
 
Share this answer
 
v2
Comments
Sarrrva 28-Sep-12 7:01am    
Exactly Correct Answer friend..

+5!

thanks and regards
sarva
RaisKazi 30-Sep-12 12:18pm    
My 5!

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