Regular Expression

  • Thread starter Thread starter Aaron
  • Start date Start date
A

Aaron

how can i write a function that returns true when it sees
"textbox1.value" (without quotes) only and returns false when it sees
func(textbox1.value, var) or anything else.

Thanks,
Aaron

example text
----------------------------
some line
func(textbox1.value, var)
some line
some line
textbox1.value
some line
----------------------------
 
I'm assuming he'd actually have whitespace. It would be very
odd to have textbox1.Value on a line by tiself, since you need some
form of assignment variable or other feature to make the code useful.

?(m)^\s*textBox1.Value

Will match any textBox1.Value that appears at the start of a line. If you
are specifically looking for instances where someone assigns something
to textBox1.Value then you'd want:

textBox1.Value[\s\n]*=[^=]

The above will match textBox1.Value followed by an equals operator
that isn't itself followed by a second (two equals operators is not an
assignment).
 
Back
Top