Eat the timestamp first, then eat the nonwhitespace
use Data::Dump; $_ = q{cOne cTwo cThree 1 min 2 sec cFour }; dd[ m/(\d+\smin\s\d+\ssec|\S+)/g ] __END__ ["cOne", "cTwo", "cThree", "1 min 2 sec", "cFour"]

perlintro#More complex regular expressions /perlrequick/split

         
    # my $regstr = join '', ; # The regular expression (PPI::Token::Regexp::Match): ; #
# m/(\d+\smin\s\d+\ssec|\S+)/g
#
# matches as follows:
#r: PPIx::Regexp / PPI::Token::Regexp::Match
#r= "m/(\\d+\\smin\\s\\d+\\ssec|\\S+)/g"
#
          "m",
      # address=/1/C0 ; xRe::Token::Structure ; Represent structural elements.
#"m",
# ------------------------------------------------------------------
               
       # address=/1/C1 ; xRe::Structure::Regexp ; Represent the top-level regular expression
# ------
            "/",
       # address=/1/C1/S0 ; xRe::Token::Delimiter ; Represent the delimiters of the regular expression
#"/",
# ------------------------------------------------------------------
                     
          # # address=/1/C1/C0 ; xRe::Structure::Capture ; Represent capture parentheses.
# number=1 alias "$1" or "\1"
# ------------
                  "(",
          # address=/1/C1/C0/S0 ; xRe::Token::Structure ; Represent structural elements.
#"(",
# ------------------------------------------------------------------
                      "\\d",
            # # address=/1/C1/C0/C0 ; xRe::Token::CharClass::Simple ; This class represents a simple character class
# \d Match a decimal digit character.
# [0-9]
# L<perldebguts/DIGIT>
# L<perlrecharclass/\d>
# L<perlrebackslash/\d>
#"\\d",
# ----------------
                      "+",
            # # address=/1/C1/C0/C1 ; xRe::Token::Quantifier ; Represent an atomic quantifier.
# match preceding pattern 1 or more times
# (matching the most amount possible)
# match the preceding pattern at address=/1/C1/C0/C0
#"+",
# ----------------
                      "\\s",
            # # address=/1/C1/C0/C2 ; xRe::Token::CharClass::Simple ; This class represents a simple character class
# \s Match a whitespace character.
# L<perlrecharclass/\s>
# L<perlrebackslash/\s>
#"\\s",
# ----------------
                      "m",
            # # address=/1/C1/C0/C3 ; xRe::Token::Literal ; a literal character
# ordinal= ord( chr( 109 ) ) alias \N{U+006D} alias \155 alias LATIN SMALL LETTER M alias m
#"m",
# ------------------------------------------------------------------
                      "i",
            # # address=/1/C1/C0/C4 ; xRe::Token::Literal ; a literal character
# ordinal= ord( chr( 105 ) ) alias \N{U+0069} alias \151 alias LATIN SMALL LETTER I alias i
#"i",
# ------------------------------------------------------------------
                      "n",
            # # address=/1/C1/C0/C5 ; xRe::Token::Literal ; a literal character
# ordinal= ord( chr( 110 ) ) alias \N{U+006E} alias \156 alias LATIN SMALL LETTER N alias n
#"n",
# ------------------------------------------------------------------
                      "\\s",
            # # address=/1/C1/C0/C6 ; xRe::Token::CharClass::Simple ; This class represents a simple character class
# \s Match a whitespace character.
# L<perlrecharclass/\s>
# L<perlrebackslash/\s>
#"\\s",
# ----------------
                      "\\d",
            # # address=/1/C1/C0/C7 ; xRe::Token::CharClass::Simple ; This class represents a simple character class
# \d Match a decimal digit character.
# [0-9]
# L<perldebguts/DIGIT>
# L<perlrecharclass/\d>
# L<perlrebackslash/\d>
#"\\d",
# ----------------
                      "+",
            # # address=/1/C1/C0/C8 ; xRe::Token::Quantifier ; Represent an atomic quantifier.
# match preceding pattern 1 or more times
# (matching the most amount possible)
# match the preceding pattern at address=/1/C1/C0/C7
#"+",
# ----------------
                      "\\s",
            # # address=/1/C1/C0/C9 ; xRe::Token::CharClass::Simple ; This class represents a simple character class
# \s Match a whitespace character.
# L<perlrecharclass/\s>
# L<perlrebackslash/\s>
#"\\s",
# ----------------
                      "s",
            # # address=/1/C1/C0/C10 ; xRe::Token::Literal ; a literal character
# ordinal= ord( chr( 115 ) ) alias \N{U+0073} alias \163 alias LATIN SMALL LETTER S alias s
#"s",
# ------------------------------------------------------------------
                      "e",
            # # address=/1/C1/C0/C11 ; xRe::Token::Literal ; a literal character
# ordinal= ord( chr( 101 ) ) alias \N{U+0065} alias \145 alias LATIN SMALL LETTER E alias e
#"e",
# ------------------------------------------------------------------
                      "c",
            # # address=/1/C1/C0/C12 ; xRe::Token::Literal ; a literal character
# ordinal= ord( chr( 99 ) ) alias \N{U+0063} alias \143 alias LATIN SMALL LETTER C alias c
#"c",
# ------------------------------------------------------------------
                      "|",
            # # address=/1/C1/C0/C13 ; xRe::Token::Operator ; Represent an operator.
# OR ; Alternation ; match_left OR match_right
#"|",
# ------------------------------------------------------------------
                      "\\S",
            # # address=/1/C1/C0/C14 ; xRe::Token::CharClass::Simple ; This class represents a simple character class
# \S Match a non-whitespace character.
# L<perlrecharclass/\S>
# L<perlrebackslash/\S>
#"\\S",
# ----------------
                      "+",
            # # address=/1/C1/C0/C15 ; xRe::Token::Quantifier ; Represent an atomic quantifier.
# match preceding pattern 1 or more times
# (matching the most amount possible)
# match the preceding pattern at address=/1/C1/C0/C14
#"+",
# ----------------
                  ")",
          # # address=/1/C1/C0/F0 ; xRe::Token::Structure ; Represent structural elements.
# end of grouping for number=1 alias "$1" or "\1"
#")",
# ------------------------------------------------------------------
            "/",
       # address=/1/C1/F0 ; xRe::Token::Delimiter ; Represent the delimiters of the regular expression
#"/",
# ------------------------------------------------------------------
          "g",
      # # address=/1/C2 ; xRe::Token::Modifier ; Represent 1)embedded pattern-match modifiers or 2)(trailing) modifiers for operators match, substitution, regexp constructor
# /g Match globally, i.e., find all occurrences.
# in list context (@matches=m//g) return all matches; in scalar context($count=m//g) return number of matches
#"g",
# ------------------------------------------------------------------
         
    ;;;;;;;;;;

In reply to Re: Regex for non-patterned input by Anonymous Monk
in thread Regex for non-patterned input by sidsinha

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.