Posts

Showing posts with the label RegExp

Regular Expression - Documentation

  Metacharacters Character What does it do? $ Matches the  end of the input . If in multiline mode, it also matches  before a line break character , hence every end of line. (?:x) Matches 'x' but  does NOT remember the match . Also known as NON-capturing parenthesis. (x) Matches 'x' and  remembers the match . Also known as capturing parenthesis. * Matches the preceding character  0 or more times . + Matches the preceding character  1 or more times . . Matches  any single character except the newline character . ? Matches the preceding character  0 or 1 time . When used after the quantifiers *, +, ? or {},  makes the quantifier non-greedy ; it will match the minimum number of times as opposed to matching the maximum number of times. [\b] Matches a  backspace . [^abc] Matches  anything NOT enclosed by the brackets . Also known as a negative character set. [abc] Matches  any of the enclosed characters . Also known as a charac...

How to Use the VBScript RegExp Object

  Hi All, I faced a situation where I had to update the field’s value from another file. I can not use the string replace method because It will replace the all the matches value, While I want to replace the first match with the first value of another file.  Here I am trying to explain First File Contents: This blog refers to QTP. I want to get first line value "="   from another file. Here I am using Rexexp with global property value false Now I want to get Second line value "="   from another file. Global property false will serach only first match If regexp global property true then it search all the matches Now I want to get Third line value "="   from another file. Second File Contents: Rajiv Kumar Nandvani I want output like this: This blog refers to QTP. I want to get first line value " Rajiv "  from another file. Here I am using Rexexp with global property value false Now I wan...