You are not logged in.
How to find a string with exaclty one occurence of some letter?
For example that regular expresion must match "3434w3456" and not match "642w567w4".
thanks
Offline
I doubt that you can express what you want as a regular expression... So I doubt grep can do this...
But I'm quite sure that sed can...
Unfortunately the only sed command I know and I ever needed is the replace command s/x/y/ ...
Offline
Regex can do it with ^ inside brackets which negates it.
grep '^[^w]*w[^w]*$'
Offline
thanks, Procyon.
Offline
I doubt that you can express what you want as a regular expression... So I doubt grep can do this...
But I'm quite sure that sed can...
Both sed and grep use regular expressions so their are equally powerful, and since you can easily design a finite state automaton for the language the OP is trying to match, it is certainly a regular language.
Offline