Click here to Skip to main content
15,898,371 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
i want to remove the word after the equals to sign . i tried many regex but its actually not according to the requirement.Please help me out .

for ex : e =abc

now, what would be the regex for removing the abc after equals to .

thanx in advance
Posted
Comments
phil.o 10-Feb-15 8:02am    
<quote>"i tried many regex"
Then would you mind showing them to us?
Naina2 10-Feb-15 8:04am    
yeah sure ..these are one of them .. i m trying something new b/w them.
(?>=)\w+

@"\B\w*[a-z0-9]+\w*\B"
Sinisa Hajnal 10-Feb-15 8:18am    
Use IndexOf to find "=", use IndexOf to find first space after =. Remove everything between the two. You don't need regex, it would be more elegant, but you're introducing something that is hard to read, test and maintain for simple problem.

1 solution

Simple regex for doing this is :

@"(?<==)\S+"
 
Share this answer
 

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