10-07-2013 04:00 PM
hello,
How to have the "opposite" of a reference ?
(sorry for my bad english, i do my best)
(3)[^3] matches "32", "3a" ...
I would like to replace the second term < [^3] > by a reference to the first term < (3) > .... ...\1 instead of [^3]
The problem is the " ^ " ... and obviously, (3)[^\1] does not work !
in other words, all except " \1 "
is there a way to do that ?
Thanks to all,
10-07-2013 04:15 PM - edited 10-07-2013 04:19 PM
show us an example input string....and what results you want from it?
Also, look at "regular expressions board"
10-07-2013 04:45 PM
thank you Apok,
but i don't need a particular/specific résult from a input string ...
it's not the purpose of my question.
i'm learning the regular expressions, and i just asked myself this question
is it possible to have the opposite of a reference ?
all exept this reference ... is there a way with PCRE to do that ?
10-08-2013 01:44 AM
@ouadji wrote:
hello,
How to have the "opposite" of a reference ?
(sorry for my bad english, i do my best)
(3)[^3] matches "32", "3a" ...
I would like to replace the second term < [^3] > by a reference to the first term < (3) > .... ...\1 instead of [^3]
The problem is the " ^ " ... and obviously, (3)[^\1] does not work !
in other words, all except " \1 "
is there a way to do that ?
Thanks to all,
(3)[^\1] seems to work if you use Match Regular Expression and not Search and replace.
See attached.
/Y
10-08-2013 02:49 AM
Yes, i use "Match regular expression" (and not Search and Replace)
but (.)[^\1] in your attached Vi does not work (with LV 2013)
with an input string "3313" , (.)[^\1] matches "33" .. this is not the good résult ...
it should match "31" ( 3 and all exept 3 )
it works for you with LV2011 ???
10-08-2013 04:36 AM
You're right, it only matches the 2 first chars regardless!
If you change it to "(.)[\1]" it should get the first instance of double characters, which it also doesn't.
/Y
10-09-2013 09:41 AM
Hello Ouadji,
While checking out this question I saw that it might be linked to a question in the BreakPoint section.
I'm just going to refer to it from over here to close the loop:
http://forums.ni.com/t5/BreakPoint/Regular-Expressions-Board/td-p/1187799/page/13