SOLVED
Regex
Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
praneshsapmm
8 - Asteroid
‎12-30-2021
02:46 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi ,
I have this requirement to extract a sub string from the given string meeting below requirements .
1. No leading zeros
2. No leading and trailing alphabets (uppercase & lower case)
3. Begin with number and end with number
For example :
String : AAA00012A300B0BB
Result : 12A300B0
String : 000AAA12A300B0BB
Result : 12A300B0
Thanks .
Solved! Go to Solution.
Labels:
- Labels:
- Regex
3 REPLIES 3
Jonathan-Sherman
15 - Aurora
‎12-30-2021
03:01 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi @praneshsapmm,
I would go with a Regex_Replace() function:
REGEX_Replace([String],"^([A-Z]|[0-9])\1{2,}([A-Z]|[0-9])\2{2,}(.*?)[A-Z]*$","$3")
I've attached my workflow for you to download if needed!
Kind regards,
Jonathan
Qiu
21 - Polaris
‎12-30-2021
04:04 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
@praneshsapmm
A slight different one
‎12-30-2021
04:06 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Thankyou . This works .
Just another help .
Can you share regex function only to delete the trailing alphabets (uppercase and lowercase) in a string .
Thanks.