Click here to Skip to main content
12,402,202 members (65,396 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.

Regards,
sarva
Posted 27-Sep-12 1:04am
Sarrrva3.5K
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

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

Solution 1

Replace ntext\(\d+\) with TEXT

Replace DEFAULT\(\((\d+)\)\) with DEFAULT '$1'
  Permalink  
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)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.160721.1 | Last Updated 30 Sep 2012
Copyright © CodeProject, 1999-2016
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