Extracting strings from stream using Regex

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • hantie

    Extracting strings from stream using Regex

    Is it possible to do this extraction in Java from the InputStream?

    <sql commands="selec t title from books" sql>
    other patterns
    ....
    ....

    The result will be just:
    select title from books

    that is extracting the fields ONLY between <sql ... sql> and between " "

    Thank you for the response


  • Roedy Green

    #2
    Re: Extracting strings from stream using Regex

    On Fri, 05 Sep 2003 16:20:24 GMT, "hantie" <hantie@hotmail .com> wrote
    or quoted :
    [color=blue]
    >Is it possible to do this extraction in Java from the InputStream?
    >
    ><sql commands="selec t title from books" sql>[/color]

    There examples very similar to that at


    Make sure you read the difference between matching and finding.
    You want to find, then possibly later match to extract the essence.

    --
    Canadian Mind Products, Roedy Green.
    Coaching, problem solving, economical contract programming.
    See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.

    Comment

    • hantie

      #3
      Re: Extracting strings from stream using Regex


      "Roedy Green" <roedy@mindprod .com> wrote in message
      news:4alhlvcskc c1ch8fr2jqlks21 rbbscdjed@4ax.c om...[color=blue]
      > On Fri, 05 Sep 2003 16:20:24 GMT, "hantie" <hantie@hotmail .com> wrote
      > or quoted :
      >[color=green]
      > >Is it possible to do this extraction in Java from the InputStream?
      > >
      > ><sql commands="selec t title from books" sql>[/color]
      >
      > There examples very similar to that at
      > http://mindprod.com/jgloss/regex.html
      >
      > Make sure you read the difference between matching and finding.
      > You want to find, then possibly later match to extract the essence.
      >
      > --
      > Canadian Mind Products, Roedy Green.
      > Coaching, problem solving, economical contract programming.
      > See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.[/color]

      Thank you Roedy


      Comment

      Working...