1

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)

RaamEE
  • 3,017
  • 4
  • 33
  • 53
  • 3
    Try `(?i)prop`. Or `[pP][rR][oO][Pp]`. – Wiktor Stribiżew Mar 26 '17 at 18:18
  • Thanks - [pP][rR][oO][Pp] works. I wasn't able to use (?i)prop - Maybe I used it wrong. I tried: /(?i)prop and also /(?i)prop/ - neither works. Following your comment I am looking further into POSIX regex. Thanks – RaamEE Mar 26 '17 at 18:47
  • I am looking into ex - https://en.wikipedia.org/wiki/Ex_(text_editor) - it supports turning on\off search case sensitivity. – RaamEE Mar 26 '17 at 19:27

1 Answers1

3

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).

Wiktor Stribiżew
  • 607,720
  • 39
  • 448
  • 563