Regex problem in MT4 - page 2

 
You don't need the caret ^ if you want to find all the "Big" words. Here's an online regular expression matcher: https://regex101.com/
Regex101
  • Firas Dib
  • regex101.com
Online regex tester, debugger with highlighting for PHP, PCRE, Python, Golang and JavaScript.
 
Alain Verleyen:

You know the word boundary, why aren't you using it then ?

I totally agree with lippmaje it was not clear and it's still not. From what you described, you don't need "^" at all. I am even wondering if you need regex at all.

Help with what ?

@lippmaje:

Yes, I know the regex tester(s). The "Big" example is just an example. Forget it.


So, you guys claim that "^" and "$" are absolutely unnecessary in regular expressions? I doubt.

I need an example, how can I use them by mql regex. Because, for example this regex doesn't work: "^Anything$", at least I couldn't get it to work.

 
linux80s:

@lippmaje:

Yes, I know the regex tester(s). The "Big" example is just an example. Forget it.


So, you guys claim that "^" and "$" are absolutely unnecessary in regular expressions? I doubt.

Nobody said that. We said it's not necessary in your example to find "Big" in "Big smile! Big pleasure! BigBig ocean!" (but not BigBig).

I need an example, how can I use them by mql regex. Because, for example this regex doesn't work: "^Anything$", at least I couldn't get it to work.

What doesn't work is your understand of regex and how they works. You should learn about them, which is not the place on this forum.

This pattern "^Anything$" will find 'Anything' ONLY if it's at the start of the string expression AND at the end. So it will find it ONLY if your string expression is "Anything" exactly.

 
Alain Verleyen:
Nobody said that. We said it's not necessary in your example to find "Big" in "Big smile! Big pleasure! BigBig ocean!" (but not BigBig).

What doesn't work is your understand of regex and how they works. You should learn about them, which is not the place on this forum.

This pattern "^Anything$" will find 'Anything' ONLY if it's at the start of the string expression AND at the end. So it will find it ONLY if your string expression is "Anything" exactly.

Exactly. But why "^Big$" did not work in my example?
 
linux80s:
Exactly. But why "^Big$" did not work in my example?
In which example, you provided a lot.
Reason: