skip to Main Content

Php – regex just take last value

my problem is when regex get any value it just take last correct one input Mozilla/5.0 (Windows Phone 10.0; Android 6.0.1; SAMSUNG; GT-I8750) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Mobile Safari/537.36 Edge/15.15063 output i get Android what real output i want…

VIEW QUESTION

Regex of PostgreSQL Connection String

I am writing a regular expression for capturing the connection string of PostgreSQL. The format of the connection string as follows: (postgresql|postgres)://[userspec@][hostspec][/dbname][?paramspec] where userspec is: user[:password] and hostspec is: [host][:port][,...] and paramspec is: name=value[&...] Here, the userspec, port, dbname and…

VIEW QUESTION

Javascript Regex Lookahead

I am not understanding why this regex pattern is not matching as expected. I am testing this pattern on https://regexr.com. regex =/^1?((?=d{3}))[-. ]?(d{3})$/ sample = 1(123) 123 My understanding is first pattern should be number 1 or nothing then 3…

VIEW QUESTION

regex goes Infinite loop for html attribute matching – Javascript

<(?<nodeName>[a-zA-Z][-a-zA-Z0-9_]*)(?<attributes>(?:s*[a-zA-Z_:!0-9,][-a-zA-Z0-9_:%."'`;(]*(?:s*=s*(?:(?:"[^"]*")|(?:'[^']*')|{{[^>}]*}}|[^>]+|w*))?)*)s*(/?)> This above regex trying to match the tagName and attributes. <span class='Utils.showtt("{{getI18n('zr.ratings.reviews.client.review.tag', getCrmModuleInfo('Accounts', 'true'))}}")'> but getting infinite loop since quotes mismatched in this input. Is there any way to throw error or prevent infinite loop.

VIEW QUESTION

Regex match two value from string php

Hi i am trying to match two value by regex two conditions, But not able to do. string is MorText "gets(183,);inc();" for="text">Sweet" Mo output trying is array [ 183, "Sweet" ] php regex code is preg_match_all('/gets((.*?),|>(.*?)"/', $string, $matches);

VIEW QUESTION
Back To Top
Search