in reply to Re^2: Splitting on unusual regex
in thread Splitting on unusual regex

Something like this?

#! perl -slw use strict; my $code = <<EOC; This is some JOY code This is (some more) JOY code And this is some JOY code with escaped \\( and \\) like (this \\) and \\(this) and \\) EOC print for $code =~ m[ ( (?: \( (?: \\[()] | [^()] )+ \) ) | \S+ ) ]gx; __END__ C:\test>615217 This is some JOY code This is (some more) JOY code And this is some JOY code with escaped \( and \) like (this \) and \(this) and \)

Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
"Too many [] have been sedated by an oppressive environment of political correctness and risk aversion."

Replies are listed 'Best First'.
Re^4: Splitting on unusual regex
by dewey (Pilgrim) on May 14, 2007 at 08:45 UTC
    Exactly... man, I'm really going to have to resist the urge to put all my questions on here or I'll never write any of my code myself! Thanks a lot guys, I'm slowly improving at regular expressions.

    ~dewey