'How to achieve following in JavaScript using Regex
I want to match following pattern and split it, How can I achieve this? Thanks in advance.
Expected output of Regex from string
["any number", "only single alphabet", "+ OR -",
"only single alphabet", "+ OR -", "any single alphabet"]
or
["any number", "only single alphabet"]
or
["any number", "only single alphabet", "+ OR -",
"only single alphabet"]
Solution 1:[1]
It was solved by using this Regex, I don't know it's perfect solution or not but it works however I want.
/(^[0-9]+)([a-z])([+-]?)([a-z]?)([+-]?)([a-z]?)/g
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 |
