regexbashed

How to do a case insensitive search in ed line editor


I am trying to do a regex search with ed.

e.g.

Is there an expression that will match any case variation on the word "prop"

prop, PROP, Prop, etc. ?

I found the following additional references

ed manual

which refers to

Base Definitions volume of IEEE Std 1003.1-2001, Section 9.3, Basic Regular Expressions

GNU Basic Regular Expressions (grep, ed, sed)


Solution

  • The ed regular expression syntax, being a sort of a POSIX regular expression standard, does not seem to support case insensitive modifiers.

    You may use bracket expressions containing both upper- and lowercase letter variants:

    [Pp][Rr][Oo][Pp]
    

    where [Pp] matches a p or P, etc.

    If you plan to match prop as a whole word, you will need to use \< in front (it matches the beginning of a word) and a \> at the end of the expression (it matches the end of a word).