I want a PBasic regular expression to recognise any slash, hyphen or
space as a separator so I defined an equate as follows:
(1) $Sep = "[/- ]"
This did not work because / needs to be escaped. So I wrote
(2) $Sep = "[//- ]"
This worked for / but not for -. I tried escaping the -
(3) $Sep = "[///- ]"
But that didn't work. But this did:
(4) $Sep = "[-// ]"
In other words, the actual order of characters within [] is apparently
significant. Or am I misunderstanding something here.
My question is: Why does (4) work, but not (3) or (2)?
Any help would be most appreciated.
Ian
space as a separator so I defined an equate as follows:
(1) $Sep = "[/- ]"
This did not work because / needs to be escaped. So I wrote
(2) $Sep = "[//- ]"
This worked for / but not for -. I tried escaping the -
(3) $Sep = "[///- ]"
But that didn't work. But this did:
(4) $Sep = "[-// ]"
In other words, the actual order of characters within [] is apparently
significant. Or am I misunderstanding something here.
My question is: Why does (4) work, but not (3) or (2)?
Any help would be most appreciated.
Ian
Comment