LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Match pattern

Can anyone tell me how to set up a match pattern so that it does not
confuse these two strings:

>
prompt>

If the regular expression is ">", it will find it in the "prompt>"
string. I do not wish for this to occur. I wish for the match pattern
to detect the ">" case separately from the "prompt>" case. Since I do
not know which one will be present in the string, I have to account for
both conditions.

Thanks in advance.

Scott
0 Kudos
Message 1 of 5
(3,476 Views)
Hi Scott

Just playing around with a few Match patterns. If you try the regular
expression: ".+[>]" (without the quotes) with the Match Pattern function,
a match is only found when there is 1 or more characters preceding the
">", or else the Match Pattern function returns "-1" at the "offset past
match" output terminal. Is this what you wanted?

Paul

--

Research Assistant
School of Physiotherapy, Curtin University of Technology
Selby Street, Shenton Park, Western Australia, Australia. 6008
email: P.C.Davey@curtin.edu.au
Tel. +61 8 9266 4657 Fax. +61 8 9266 3699

"Everyone who calls on the name of the Lord will be saved." Romans 10:12
"For all have sinned and fall short of the glory of God, and are justified
freely by his grace through the redemption that came
by Christ Jesus."
Romans 3:23-4


Scott Serlin wrote:

> Can anyone tell me how to set up a match pattern so that it does not
> confuse these two strings:
>
> >
> prompt>
>
> If the regular expression is ">", it will find it in the "prompt>"
> string. I do not wish for this to occur. I wish for the match pattern
> to detect the ">" case separately from the "prompt>" case. Since I do
> not know which one will be present in the string, I have to account for
> both conditions.
>
> Thanks in advance.
>
> Scott
0 Kudos
Message 2 of 5
(3,476 Views)
does anything appear in the string immediately before the ">", such as a
"newline", tab or space?

if so, you could match pattern to " >" or whatever, in which case "t>" would
not qualify.


Scott Serlin wrote in message <397DCF41.4DA1C2E1@comm.mot.com>...
>Can anyone tell me how to set up a match pattern so that it does not
>confuse these two strings:
>
>>
>prompt>
>
>If the regular expression is ">", it will find it in the "prompt>"
>string. I do not wish for this to occur. I wish for the match pattern
>to detect the ">" case separately from the "prompt>" case. Since I do
>not know which one will be present in the string, I have to account for
>both conditions.
>
>Thanks in advance.
>
>Scott
>
>
>
0 Kudos
Message 3 of 5
(3,476 Views)
On Tue, 25 Jul 2000 12:32:49 -0500, Scott Serlin
wrote:

>Can anyone tell me how to set up a match pattern so that it does not
>confuse these two strings:
>
>>
>prompt>

Look up in the online help (i mean the real online help not the small
help window 🙂 or the manual and you will find a more information
about (LabVIEW's) regular expressions.

By the way, your match string should be "^>" to match > at start of
string or "^>$" to match a string with only >
(Match string should be without the quotes)

--
Rolf
0 Kudos
Message 4 of 5
(3,476 Views)
Scott,

I'm a novice to LabView, but this is what I would try. Search for the '>'
character, if the result is position 0, then you have the right one. A
greater returned value means it has a prefix of some sort. You could also
try checking the length of the prompt while you are checking the content.

I hope this makes sense, I'm normally a VeeTest user, just getting into
LabView.

Tom H.

Scott Serlin wrote in message <397DCF41.4DA1C2E1@comm.mot.com>...
>Can anyone tell me how to set up a match pattern so that it does not
>confuse these two strings:
>
>>
>prompt>
>
>If the regular expression is ">", it will find it in the "prompt>"
>string. I do not wish for this to occur. I wish for the match pattern
>to detect the ">" case separately from the "prompt>" cas
e. Since I do
>not know which one will be present in the string, I have to account for
>both conditions.
>
>Thanks in advance.
>
>Scott
>
>
>
Certified LabVIEW Developer
0 Kudos
Message 5 of 5
(3,476 Views)