Search code examples
regexfitnesse

Fitnesse regular expression with pipe


I am using fitnesse, and i need to match 2 possible outputs.

My script table looks like this:

|script|MyClass|
|check|doSomething|value|=~/Result1|Result2/|

My problem is that the pipe | in the regex is read as a column separator instead. Is there a way to escape the pipe character?


Solution

  • A quick googling brought this escape sequence up:

    !-|-!
    

    See here, here and here.

    For increased readability you should probably use it like this:

    |check|doSomething|value|!-=~/Result1|Result2/-!|