meson: Extract flex version using a regex inside a script

Different builds of Flex on different platforms output different strings
in --version. For example:

macOS:
flex 2.5.35 Apple(flex-31)

Windows:
win_flex.exe 2.6.4
C:\Program Files (x86)\GnuWin32\bin\flex.EXE version 2.5.4

We need to look for a string that looks like a version, which means
a regex till https://github.com/mesonbuild/meson/issues/1609 is fixed.

Fixes gstreamer/gstreamer#356
9 jobs for fix-flex-checking in 25 minutes and 23 seconds (queued for 1 second)
Status Job ID Name Coverage
  Preparation
passed #104392
gst indent

00:00:32

passed #104391
manifest

00:00:19

 
  Build
passed #104393
build fedora x86_64

00:02:22

 
  Test
passed #104394
check fedora

00:03:38

 
  Full Builds
passed #104395
build android arm64 api28

00:03:05

passed #104431
build cerbero cross win32

00:08:08

passed #104398
build cerbero cross win64

00:09:36

passed #104396
build cerbero fedora x86_64

00:10:40

failed #104397
build cerbero cross win32

00:00:58