July 29th, 2012, 09:37 AM
Regular Expression error.
I have a string "deOne 3 wjb2j1kk Two jkj[B212<221d>2w<xj21>]Onenn3n3[C14]dddd Two d"
and patern : "One[^-(Two)]*Two"
All I want is result:
But I receive :
Please give me a advice.
July 29th, 2012, 10:14 AM
A character class [...] consists of single characters (hence the name). So [^-(Two)] means: any character except one of the six characters "-", "(", "T", "w", "o", ")".
What you're trying to do doesn't work that way and is much more complex. You're regex engine needs to support negative lookahead pattern.
July 29th, 2012, 10:18 AM
Can you give me correct pattern ?
Originally Posted by Jacques1
July 29th, 2012, 10:57 AM
I'd simply use a non-greedy quantifier:
You might need to configure the "." pattern to also include new lines.
July 29th, 2012, 11:03 AM