RegEx, AHK, MS Word

Post a reply


In an effort to prevent automatic submissions, we require that you complete the following challenge.
Smilies
:D :) ;) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :!: :?: :idea: :| :mrgreen: :geek: :ugeek: :arrow: :angel: :clap: :crazy: :eh: :lolno: :problem: :shh: :shifty: :sick: :silent: :think: :thumbup: :thumbdown: :salute: :wave: :wtf: :yawn: :facepalm: :bravo: :dance: :beard: :morebeard: :xmas: :HeHe: :trollface: :cookie: :rainbow: :monkeysee: :monkeysay: :happybday: :headwall: :offtopic: :superhappy: :terms: :beer:
View more smilies

BBCode is ON
[img] is OFF
[flash] is OFF
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: RegEx, AHK, MS Word

Re: RegEx, AHK, MS Word

Post by pom » 27 Feb 2015, 06:57

TLM wrote:Looks like the `Any single character` or ? token is being repeated in this case ( not sure why )..
Yes... :?
TLM wrote:try: hig[a-z]{1,6} tem
That worked well in this situation. Thank you! :)

Re: RegEx, AHK, MS Word

Post by TLM » 27 Feb 2015, 03:24

While wild card search is similar to RegEx, its definitely not the same.
Looks like the `Any single character` or ? token is being repeated in this case ( not sure why )..
Also wildcards deal with spaces much differently than RegEx.

After some messing around I've come to realize you can't use space as a `special character`..
try: hig[a-z]{1,6} tem

htms

RegEx, AHK, MS Word

Post by pom » 24 Feb 2015, 07:42

This is Haystack:
higher temperature
random text
higher random text random text temperature
This is NeedleRegEx: hig.{1,6}tem, which finds the following (red) pattern:
higher temperature
random text
higher random text random text temperature
However, when I go to MS Word's Advanced Find, check "use wildcards" checkbox and type hig?{1,6}tem , which is compatible with hig.{1,6}tem NeedleRegEx, it finds the following (red) patterns:
higher temperature
random text
higher random text random text temperature
Why does it find higher random text random text tem pattern? If I understand this correctly, it shouldn't find it because there are much more than 6 characters between hig and tem. But it finds it… Why? I don't understand am I doing something wrong or is it a bug in MS Word?
Thanks.


Moderator: moved from Ask for Help since this is not an AHK question.

Top