The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 895 - File: showthread.php PHP 7.2.34 (Linux)
File Line Function
/showthread.php 895 errorHandler->error




Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
regex doesn't work: my error or bug?
#1
Hi Gintaras,
this regex (PCRE flavour) finds the substring between two single quotes:
Code:
Copy      Help
(?<=')(.*?)(?=')

It works well when tested in RegexBuddy 4, 
[Image: htdvd4.png]
in https://regexr.com and https://www.regexpal.com:

[Image: 2uglztg.png] [Image: 9jls1h.png]

but if fails in QM:

Code:
Copy      Help
str userNamePattern username risultato
username="WHERE nomepass = 'testname'"
userNamePattern = "(?<=')(.*?)(?=')"
if(findrx(username userNamePattern 0 0 risultato 2)>=0)
    out risultato
else
    mes "match for ''(?<=')(.*?)(?=')'' not found" "Error"

[Image: j5i0wl.png]

is it my fault?

Again thank you for your exceptional support.


Messages In This Thread
regex doesn't work: my error or bug? - by zandar - 03-01-2018, 08:02 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)