Avatar of NevSoFly
NevSoFly

asked on 

Can't get the character set of [^]] to match "]" in regex (([^[])(-?\w)/)|(/(-?\w)([^]])).

I'm trying to create a regex that only matches when:
An alphanumeric character that is not preceded by "[" but is followed by "/"
and a "/" & an alphanumeric character when there isn't a "]" in front of it.

for example:
1[ts/tty]/a..[a/bravo] ntf/dt; c/[antenna/board] --->  should match /a, /d and c/

So far I have (([^[])(-?\w)/) ---> this matches /d and c/ but not /a.  I have tried (([^[])(-?\w)/)|(/(-?\w)([^]])) but can't get the character set of [^]] to match "]".
Regular Expressions

Avatar of undefined
Last Comment
NevSoFly

8/22/2022 - Mon