search exact match in string - Forum

Forum Navigation
You need to log in to create posts and topics.

search exact match in string

I need to be able to search a string for an exact match. I have 2 lines in a file located in different places that are identical except for one word in the string:

husbandryCow

husbandryCowLarge

Is there a code snippet or plugin that will do it?

Hans-Peter: would it be possible to add optional exact match to hpwlinenumber?

Hello Wrangler,

To understand it right: When you search for husbandryCow you do not want to find husbandryCowLarge.

I am not sure but a regex may be can do it since there a Logik about word bounderys exist.

When you would know the character behind husbandryCow then you could include it in your search.

This may be a space, tab or CR character.

hpwlinenumber uses the simple Delphi "Pos" command which does only support the direkt character match.

Regards

 

Hello,

Just tested the regex with hpwExecRegExpPos: \bhusbandryCow\b

This should give you the pos with your string-match at word boundery.

hpwPosToLineNumber (added 4.2018) can give you then the line-number.

Regards

Thank you Hans-Peter! I'll give it a go.

Luis: subscribing to topic doesn't seem to work. Don't get email.

Luis: subscribing to topic doesn't seem to work. Don't get email.

Hi @wrangler, I think there is an issue with your email.
Please take a look at your spam folder and be sure to add info[at]visualneo.com to your contact list.
Let me know if that solves the problem.

Regards.