Regular Expression

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Aaron

    #1

    Regular Expression

    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.v alue, var) or anything else.

    Thanks,
    Aaron

    example text
    ----------------------------
    some line
    func(textbox1.v alue, var)
    some line
    some line
    textbox1.value
    some line
    ----------------------------
  • AlexS

    #2
    Re: Regular Expression

    Hi, Aaron

    then you need to use Regex(@"\r\ntex tbox1...").

    HTH
    Alex

    "Aaron" <kuya789@yahoo. com> wrote in message
    news:b4828959.0 406151337.1d766 751@posting.goo gle.com...[color=blue]
    > 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.v alue, var) or anything else.
    >
    > Thanks,
    > Aaron
    >
    > example text
    > ----------------------------
    > some line
    > func(textbox1.v alue, var)
    > some line
    > some line
    > textbox1.value
    > some line
    > ----------------------------[/color]


    Comment

    • Justin Rogers

      #3
      Re: Regular Expression

      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*textBox 1.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).


      --
      Justin Rogers
      DigiTec Web Consultants, LLC.
      Blog: http://weblogs.asp.net/justin_rogers

      "AlexS" <salexru2000NO@ SPAMsympaticoPL EASE.ca> wrote in message
      news:%23Lei1SyU EHA.584@TK2MSFT NGP09.phx.gbl.. .[color=blue]
      > Hi, Aaron
      >
      > then you need to use Regex(@"\r\ntex tbox1...").
      >
      > HTH
      > Alex
      >
      > "Aaron" <kuya789@yahoo. com> wrote in message
      > news:b4828959.0 406151337.1d766 751@posting.goo gle.com...[color=green]
      > > 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.v alue, var) or anything else.
      > >
      > > Thanks,
      > > Aaron
      > >
      > > example text
      > > ----------------------------
      > > some line
      > > func(textbox1.v alue, var)
      > > some line
      > > some line
      > > textbox1.value
      > > some line
      > > ----------------------------[/color]
      >
      >[/color]


      Comment

      Working...