0

I am looking at someone elses code and have a question. Below is the code. Where it says: ^DR DUE does that mean the string starts with DR DUE? I am new to perl regular expressions. Also, where ATM/(DEP|WTD) does this mean match ATM/(DEP|WTD) in the string? However, I thought that ( and ) were metacharacters too. Thanks for your help!

Removed

1 Answers1

-1

It will match a string containing

  • the string "COAL"
  • "DR DUE TO ATM/" placed at beginning of line and followed by "DEP" or "WTD".

So it will match:

  • COAL
  • (beginning of line)DR DUE TO ATM/DEP ERROR
  • (beginning of line)DR DUE TO ATM/WTD ERROR
mugnozzo
  • 210
  • 1
  • 15
  • There are tools that visualize regexps to make them easier to understand, e.g.: https://regexper.com/#%2FCOAL%7C%5EDR%20DUE%20TO%20ATM%5C%2F%28DEP%7CWTD%29%20ERROR%2F -- maybe that would be helpful. – eyevan Aug 31 '18 at 14:18