Regular Expression containing anything but 2 strings

Gnarl

Newcomer
Joined
Oct 22, 2004
Messages
1
Hi, I'm fairly new to regular expressions and I'm having troulbe making a regular expression that returns any substring that does not contain 2 other strings.

Basicaly, I'm looking for a regular expression that returns a string that does not contain either "a/" or "e#"

For exemple,

if applying "a/ Hello World", I would get "Hello World", "ello World", "llo World" and so on.

With my week regex skills I managed to find a way to exclude only one of the parts using [^(a/)] but when I try this [^((a/)|(e#))] it doesn't work.

Any clue on how to do this.
 
You want token parsing

You are desiring an iterative result, that is, moving through the starting string from left to right, obtain all strings of any length between the given tokens. Basically this should be done by doing token parsing, where the undesired strings are the tokens. This would give you all the strings between any tokens, and then you could take each resulting string and produce the desired sub-strings. Give me a holler if my answer is too general. :)
 
Back
Top