Regular Expression for Array Variable as ABCD[1]

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • zacksoniar
    New Member
    • Sep 2007
    • 45

    Regular Expression for Array Variable as ABCD[1]

    Hi All,

    In my application, I need to search a variable which I m searching using regular expression.

    e.g. "Set Variable1 to 0" This is the string & I know that Set is followed by some variable.

    So, my expression is "^Set [a-zA-Z0-9]* to 0$".

    This way I m able to find all strings of form
    'Set SOME_VARIABLE to 0'

    Now, the problem is variable could be array variable And I m not able to add '[',']' directly to expression [a-zA-Z0-9].It gives error. I tried putting '\' before '[',but of no use..

    Please Help.
    I hope I m clear with above example.
    Thanks in advance.
Working...