i’m working for a long time to get an regexp string – but without any success.
Hope, to get some help here.
There are strings in the following format:
G/20/EU (picture)/europe 21/
or
/House/200 hits/real estate
or
color/red-green/dark blue/orange/321
Global rule: split the text on the characters / ( )
So the following regexp works: ([/()])
But I also need to remove/split on single numbers. Here: 20 and 321, but NOT on 21 (which is one phrase with “europe 21”) or 200 (which is one phrase with “200 hits”)
Sometimes the strings starts with an / or ends with an /, sometimes not. Numbers can occur at the beginning, at the end or in the middle of the string.
The results should be simple words or phrases like:
G
EU
picture
europe 21
House
200 hits
real estate
color
red-green
dark blue
orange
Have anyone an idea, how an regexp could look like?
Thank you
If your regex flavour does have look ahead and behind, you can try this:
See it here on Regexr.
This will check for a series of digits, where there is a
/or the start of the row^before, and a/or the end of the row$behind.Or for your part