Click here to Skip to main content
12,948,021 members (87,090 online)
Rate this:
Please Sign up or sign in to vote.
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.

Posted 27-Sep-12 1:04am
Updated 30-Sep-12 6:16am
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!!!


1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Replace ntext\(\d+\) with TEXT

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


thanks and regards
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)

    Print Answers RSS
Top Experts
Last 24hrsThis month
OriginalGriff 5,344
CHill60 3,275
Maciej Los 2,628
Jochen Arndt 1,935
ppolymorphe 1,795

Advertise | Privacy | Mobile
Web01 | 2.8.170518.1 | Last Updated 30 Sep 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100