No capture group found in RegEx

Comments

3 comments

  • Avatar
    Graham Watts

    Hey James,

    Instead of the as field_name method, which won't work with regex, try naming the capture groups like this:


    "(?<name1>[a-z]*[0-9]*)_(?<name2>[0-9]*)(.tif|.png)"

    0
    Comment actions Permalink
  • Avatar
    James Trory

    Hi Graham,

    Oh I see how it works now, thanks. I'm using this and it works great:

    | parse regex field=file "/(?<filename>[a-z]*[0-9]*_[0-9]*.*)"

    0
    Comment actions Permalink
  • Avatar
    Graham Watts

    Glad you got it working James!


    0
    Comment actions Permalink

Please sign in to leave a comment.