4 Replies Latest reply on Sep 9, 2009 10:30 AM by _Natasha_

    Regex problem

    Sreenath Varma


      I am developing a web admin in Flex. I have an input field 'Export File Path'. This path will be saved to database and the server application will read this whenever needed. This path will be a server path and if I am not wrong, we can't put a browse button to select the path (at the server). So I am planning to validate this value using a regexp validator. I tried as given below.


      <mx:RegExpValidator id="valExportFilePath" source="{txtExportFilePath}" required="true" property="text" requiredFieldError="Export file path is required." expression="^(([a-zA-Z]\:)|(\\))(\\{1}|((\\{1})[^\\]([^/:*?<>"|]*))+)$" noMatchError="File path is not in the right format"/>


      But I am getting a compile error - Attribute "expression" was already specified for element "mx:RegExpValidator"


      I understood this is a problem because of the escape sequence (\). But I don't know wherever the escape sequences are required in the above expression. I tried a lot but couldn't figure it out. It will be great if anyone can help..