Skip to content Skip to sidebar Skip to footer

Select Non Whitespace In Each Lines Which Does Not Contain @ Symbol

I want to take all lines except which contains @ symbol This is the regex for it ^[^@]*$/gm Now how do i select only words in it as \S\S*? Finally i want to combine these two regex

Solution 1:

You probably need to make it a two-step process: First filter all lines by /^[^@]*$/, afterwards get all matches for /\S+/ from that line. You can't have an arbitrary number of matches from a single regex (e.g. all »words« individually). Unless you want all words separated by whitespace in a single match, such as /\S+(\s+\S+)*/, but even then you'd essentially just get the whole line in a single match, so there's little point to it.


Post a Comment for "Select Non Whitespace In Each Lines Which Does Not Contain @ Symbol"