Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

RegEx mistake or bug



  • Please log in to reply
2 replies to this topic
toralf
  • Moderators
  • 4035 posts
  • Last active: Aug 20 2014 04:23 PM
  • Joined: 31 Jan 2005

Trying to NOT find "a"

Test =
(
Just a trial
a  c
c
 b
to see what RegEx finds
)

MsgBox, % RegExMatch(Test, "U`nm)^a.*(?!c)")

RegEx always finds "a" on position 14 even though I used negative look-ahead for "c"

 

Bug or mistake?


Ciao
toralf
 
I use the latest AHK version (1.1.15+)
Please ask questions in forum on ahkscript.org. Why?
For online reference please use these Docs.

TLM
  • Administrators
  • 3864 posts
  • Last active:
  • Joined: 21 Aug 2006
✓  Best Answer

not a bug just a slightly incorrect needle (and example)

Test =
(
Just a trial
a  c
a
 b
to see what RegEx finds
)

MsgBox, % RegExMatch(Test, "`am)^a(?!.*c)")

Posted Image

don't duplicate, iterate!


toralf
  • Moderators
  • 4035 posts
  • Last active: Aug 20 2014 04:23 PM
  • Joined: 31 Jan 2005

Thanks a lot.


Ciao
toralf
 
I use the latest AHK version (1.1.15+)
Please ask questions in forum on ahkscript.org. Why?
For online reference please use these Docs.