#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2013
    Posts
    1
    Rep Power
    0

    Regex to match comma(,) not escaped by slash(\)


    Below is my regex and the corresponding data. Can somebody help me to modify this such that I want values on FP and VIEW based on data seperated by comma(,) but not by escaped comma(\,). That is the result I want is

    value in FP is Mac\, O\,S\\ X and
    value in VIEW is default
    value in NAME is jingo

    regex
    "(?<FP>[^,]*),(?<VIEW>[^,]*),(?<NAME>[^,]*)"

    Data:
    Mac\, OREEE\,S\\ X,default,jingo

    Can somebody help me on this please
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2013
    Location
    /dev/null
    Posts
    164
    Rep Power
    19
    Code:
    (?<FP>.*?(?<!\\)),(?<VIEW>[^,]*),(?<NAME>[^,]*)

IMN logo majestic logo threadwatch logo seochat tools logo