Hi Maor,

In vfr.vfr file (MdeModulePkg/Universal/DriverSampleDxe), it has a similar 
sample code like below, I think you can use below code to meet your request.
    //
    // Define a string (EFI_IFR_STRING)
    //
    string    varid    = MyIfrNVData.MyStringData,
              prompt   = STRING_TOKEN(STR_MY_STRING_PROMPT2),
              help     = STRING_TOKEN(STR_MY_STRING_HELP2),
              flags    = INTERACTIVE,
              key      = 0x1236,
              minsize  = 6,
             maxsize  = 40,
              inconsistentif prompt = 
STRING_TOKEN(STR_STRING_CHECK_ERROR_POPUP),
                pushthis != stringref(STRING_TOKEN(STR_STRING_CHECK))
              endif
    endstring;

Thanks,
Eric
From: Maor Dickman [mailto:[email protected]]
Sent: Sunday, December 14, 2014 8:39 PM
To: [email protected]
Subject: [edk2] HII VFR string - Validate IPv4 addresses

Hi everyone,

On the subject of HII VFR forms.
I'm trying validate if the input string in my form is legal IPv4 address using 
"match" statement.
I didn't find any good example for proper usage of "match" statement and all my 
tries to use it failed.

Here is my last attempt:

Vfr:
        string
          name = ipv4,
          varid    = Mlx4NVData.IscsiInitiatorIpv4Addr,
          questionid  = CMD_ IPV4_ADDR,
          prompt   = STRING_TOKEN(STR_ IPV4_ADDR),
          help     = STRING_TOKEN(STR_ IPV4_ADDR_HELP),
          flags    = 0,
          minsize  = 0,
          maxsize  = 15,
          default = STRING_TOKEN(STR_HELP_EMPTY2),
          inconsistentif prompt = STRING_TOKEN(STR_ISCSI_INIT_IPV4_ADDR_HELP),
                match(questionref(ipv4),stringref(STRING_TOKEN(STR_IP_FORMAT)))
          endif
        endstring;


#string STR_IP_FORMAT                                                           
                                   #language en-US                             
"([0-9]{1,3}[.]){3}[0-9]{1,3}"

My questions are:

-          What I'm doing wrong?

-           Is there a sample or some guide of how to use "match" statement ?

Thanks and Regards.
Maor Dickman
------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk
_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-devel

Reply via email to