user> (def testcase "Line 1\nLine 2\nTarget Line\nLine 4\nNot a target line") #'user/testcase user> (re-seq #"(?im)^target" testcase) ("Target") user> (re-seq #"(?im)target" testcase) ("Target" "target") user>
You need to enable multiline mode: MULTILINE public static final int *MULTILINE* Enables multiline mode. In multiline mode the expressions ^ and $ match just after or just before, respectively, a line terminator or the end of the input sequence. By default these expressions only match at the beginning and the end of the entire input sequence. Multiline mode can also be enabled via the embedded flag expression (?m). On Wed, May 29, 2013 at 9:18 AM, Peter Mancini <pe...@cicayda.com> wrote: > (def testcase "Line 1\nLine 2\nTarget Line\nLine 4\nNot a target line") > (println testcase) > (re-seq #"(?i)^target" testcase) > (re-seq #"(?i)target" testcase) > > Line 3 finds nothing. It should find the third line, first word. > Ultimately I'd like #"(?i)^Target.*$" to work in finding the entire line. I > am confused why this is failing. Where do I find all the switches? I only > found (?i) because of comments. Where is it in the documentation? Thanks! > > P.S. I did read the java documentation and that wasn't much help. > > -- > -- > You received this message because you are subscribed to the Google > Groups "Clojure" group. > To post to this group, send email to clojure@googlegroups.com > Note that posts from new members are moderated - please be patient with > your first post. > To unsubscribe from this group, send email to > clojure+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/clojure?hl=en > --- > You received this message because you are subscribed to the Google Groups > "Clojure" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to clojure+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/groups/opt_out. > > > -- Ben Wolfson "Human kind has used its intelligence to vary the flavour of drinks, which may be sweet, aromatic, fermented or spirit-based. ... Family and social life also offer numerous other occasions to consume drinks for pleasure." [Larousse, "Drink" entry] -- -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.