Forum Discussion

Kris_Kelley_107's avatar
Kris_Kelley_107
Icon for Nimbostratus rankNimbostratus
May 18, 2005

Regular expressions and control characters.

Simply put, I'm trying to use matches_regex to locate a string that will be terminated with a control character, <0x0d> (the carriage return) to be precise.

 

 

I've tried using "\r", "[:ctrl:]", and even putting "<0x0d>" within the expression. None of that has worked. What can I add to my regex so that the carriage return, or at least a class of characters that contains the carriage return, will be looked for?

 

 

Thanks!
  • Never mind, I found a way around it by running matches_regex on the output from the findstr() function. Thanks!
  • Deb_Allen_18's avatar
    Deb_Allen_18
    Historic F5 Account
    You might want to try these:

     

     

    if $string contains "\r"

     

     

    if $string ends_with "\r"