Menu

A RegExp search/replace question

2005-04-15
2012-11-13
  • cool tapori

    cool tapori - 2005-04-15

    Hi,

    I am using v2.9.

    What regular expression should I use to replace all occurences of rsRun("RunID") with rsRun(FieldCol("RunID")) or rsWeights("WeightID") with rsWeights(FieldCol("WeightID"))

    I am new to regular expressions.

    I used
    Search - rs(.+)\((.+)\)
    Replace with - rs\1(FieldsCol(\2))

    It only finds strings where do not have any characters after the search term. So it does not find strings properly in the following statements

    If Not IsNull(rsWeights("WEIGHT")) Then mRowWeights(lRow, lWeight) = Val(rsWeights("WEIGHT"))

    Also it selects

    rSubCol(lRow)) And iSDate(lSubGroup(lGrp))

    which I dont want.

    Any help is appreciated. Thanks.

    Brij

     
    • Don HO

      Don HO - 2005-04-17

      rs[^(.]+\([^(^).]+\) or rs[a-zA-Z]+\([a-zA-Z"]+\) will do it.
      If you don't want rSubCol(lRow)) to be selected, check "Match case" box.

      Don

       
      • Nobody/Anonymous

        This reply was helpful to me too, although I am not the OP.  Thank you Don.

         
        • Nobody/Anonymous

          You're welcome, although I am not Don.