TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
mary jean ligas
NA
420
196.7k
How to use regex to insert space before the formatted text?
Feb 14 2017 8:25 PM
how to use regex to insert space before the formatted text.
Example:
string currentText = "~124|NSCREMBEN260901|E|PDDTS00000713398 HSBC0100000|METROPOLITAN BANK AND TRUST|COMPANY|/5010494003 USD 7,826,413.65";
the target format is in "|E|" and I want an output like " |E|". My current expression use was this Regex rgx = new Regex(@"(?<=\|[a-zA-Z0-9]\|)"); but the out put was incorrect the space was happen after the formatted text "|E| ". Please help me in this logic as I am not mastered using regular expression. Thank you so much
Current output(but it is not correct)
~124|NSCREMBEN260901|E| PDDTS00000713398 HSBC0100000|METROPOLITAN BANK AND TRUST|COMPANY|/5010494003 USD 7,826,413.65";
I need output like this:
~124|NSCREMBEN260901 |E|PDDTS00000713398 HSBC0100000|METROPOLITAN BANK AND TRUST|COMPANY|/5010494003 USD 7,826,413.65";
Reply
Answers (
7
)
vb.net 2012 resource file missing
web service using web url need help