Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    varajgandhi
    @varajgandhi
    okay, it's only for the first digit, what about 2 to 8 digits?
    glenveegee
    @glenveegee
    What is the format of the phone number
    What are the possible formats should I say
    varajgandhi
    @varajgandhi
    the first number must start with 8 or 9 and 2 to 8 digits accept 0 to 9
    glenveegee
    @glenveegee
    [89]\\d{2,8}
    varajgandhi
    @varajgandhi
    i will try
    not working ..
    glenveegee
    @glenveegee
    Any error or hint why?
    varajgandhi
    @varajgandhi
    throws error
    glenveegee
    @glenveegee
    which is?
    varajgandhi
    @varajgandhi
    image.png
    glenveegee
    @glenveegee
    And which box is being validated by that regex
    ^\+\d{2}|[89][0-9]{7}$
    varajgandhi
    @varajgandhi
    image.png
    this field only
    glenveegee
    @glenveegee
    Either <plus> with 2 digits or eight digits starting with 8 or 9
    varajgandhi
    @varajgandhi
    either digits starting with 8 or 9
    glenveegee
    @glenveegee
    If that's the case then you don't need the 2 to 8 condition
    Also if you definitely don't want to have a number longer than 8 digits you're going to have to use the multiline flag
    lastly in case the slash \ characters are causing trouble you could set it as follows:
    ^[89][0-9]{7}$
    if that doesn't work then there's something else going on.
    Make sure you're trimming values before trying to match them
    but other than that the regex above will only match a maximum of 8 digits where the starting digit is either an 8 or a 9
    varajgandhi
    @varajgandhi
    okay , i will try
    its not working,,anyway thank you for your timely support..
    glenveegee
    @glenveegee
    :thumbsup:
    You could always try confirming if there's something else going on by setting a very loose regex
    .*
    If that fails then there's definitely something screwed
    and if that passed you could slowly build up the regex to determine what exactly is causing the problem
    varajgandhi
    @varajgandhi
    Default validation takes for a phone number field, based on country code starting number validation, currently 3,6,8,9 accepts in the first digit, but the client wants only 8 or 9 as a starting digit. so only am tried to override the validation..
    glenveegee
    @glenveegee
    Perhaps try something like a regex playground to work out what you need based on what you have
    varajgandhi
    @varajgandhi
    yeah already am using this one..anyway thank you so much glen
    Jason Bullen
    @Bullenj01

    Struggling with this data all day. I'm fairly new to jmes and thinking I'm missing something fundamental here that I hope you may assist with

    { "imdata": [ { "l1PhyIf": { "attributes": { "dn": "pod-1/130/eth1-30" "adminSt": "enabled" }, "children": [ { "ethpmPhysIf": { "attributes": { "allowedVlans": "10" } } } ] } } ] }

    Trying to group values from children as another k,v pair with data from attributes without it being in another sublist. end result would look like

    "switch_name": "pod-1/130/eth1-30" "status": "enabled" "vlans": "10"

    Jason Bullen
    @Bullenj01

    this is what I have but I don't want vlans in another list

    imdata[].l1PhyIf.{status:attributes.adminSt,vlans:children[].*.attributes.allowedVlans}

    Code Warrior
    @pr0gramar
    Hi all - is there a way to add another key the output that is conditional based on value of an existing key?
    glenveegee
    @glenveegee
    @Bullenj01 as soon as you're talking about grouping values then the standard spec is not powerful enough to provide what you need. depending on the language you're working in there are other libraries out there that augment the spec and do actually provide the necessary functions to get done what it is you require
    @pr0gramar I think I understand what you mean but an example would be nice
    Guillaume Gillon
    @GGui
    Hi everyone, i use jmespath.py . is there any way get path of each response?
    Guillaume Gillon
    @GGui
    I would like to get the path in the json of each result
    Markus Geiger
    @markus-geiger

    Hi, how do i select by different key?

    aws ec2 describe-instances --instance-id "$INSTANCE_ID" \
    --query 'Reservations[0].Instances[0].BlockDeviceMappings[?(DeviceName==`/dev/sda1`)]'
    
    [
        {
            "DeviceName": "/dev/sda1",
            "Ebs": {
                "AttachTime": "2020-11-09T10:53:07+00:00",
                "DeleteOnTermination": true,
                "Status": "attached",
                "VolumeId": "vol-023ddef3ee401aa47"
            }
        }
    ]

    But i want it to be DeviceName==Reservations[0].Instances[0].RootDeviceName] ... wrong syntax?

    innocuoussoul
    @innocuoussoul

    How to a manipulate a common key to add a number to it?
    For example:
    Provider1: provider
    Provider2: provider

    Etc

    [].{provider: provider} gives me the date I want, but I want to change the key to include a number
    Essentially I need the keys to be unique values
    Paul Catinean
    @paulcatinean_gitlab
    Hi guys!
    I just discovered this library and it's such an amazing thing, wish it were more visible :D
    I am trying to filter a list of dictionaries rather than a json, I was thinking that making it to json string and then passing it to jmespath might be a bit wasteful, does jmespath also take python objects as input?