Regular expressions SQL replacement

Is there a way to use LINQ technology to search in a text string
Regular expressions are in my opinion not very intuitive.
Something along the lines of

From astring
Select WORDS
where WORD like '%hello%'

or

From astring
Select WORDS
where WORD startswith '<' AND WORD endswith '>'

WORD being a special keyword
I suppose there could be other keywords such as SENTENCE or NUMBER







Answer this question

Regular expressions SQL replacement

  • Jonas Samuelsson

    not all words are space seperated. It might be a full stop , comma or tab.
    I am thinking more along the lines of a proper parser.



  • Eric Vandenberg

    Perhaps

    from word in astring.Split(" ")
    where word.StartsWith("<") and word.EndsWith(">")
    select word

    ...



  • Gu1234

    nonetheless.. just replace split with your generator-of-choice, and the pattern should hold

  • Regular expressions SQL replacement