Regex to replace serial number in string
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi All,
i have a string in following format
( 1 ) GN49B ( 2 ) SI25B ( 3 ) SN45B ( 4 ) SN55B ( 5 ) SN60B ( 6 ) SR20B ( 7 ) SR25B ( 8 ) SR35B ( 9 ) SR4
i need the output in following way
GN49B,SI25B,SN45B,SN55B, SN60B, SR20B,SR25B,SR35B,SR4
can somebody please help me to write a regex to achieve this i am new to regex.
Solved! Go to Solution.
- Labels:
- Regex
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi @piyush
Try these 2 formulas in a formula tool. The first gets rid of the opening (1) and the next replaces the series numbers with commas.
Let me know if that helps!!
Cheers,
Esther
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi @estherb47 ,
This works fine except one condition i have some value as below
( 1 ) SSFV ( 2 )
the output is coming like this after the formula
SSFV ( 2 )
its should come like below so that i can break it using text as column using ","
SSFV,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi @piyush
You can try again, this time removing the \s (which represents spaces) from both sides. PErhaps that one instance doesn't have a space.
Let me know if that helps
Cheers!
Esther
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi @piyush ,
This site is good for testing regex before using it in Alteryx : https://regexr.com/4jf2b
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
