Zum Hauptinhalt gehen

Regular Expression (Regex) as assignment activity

Kommentare

7 Kommentare

  • Permanently deleted user

    Hi Michael,

    I've put together a sample workflow that strips non-numeric characters out of the input. You can download it (https://data.latitudegeo.com/community/regex.zip) here .

    It basically does exactly what you've described, except uses System.Text.RegularExpressions.Regex instead of System.ComponentModel.DataAnnotations.RegularExpressionAttribute.

    The Form allows the user to enter any text. Next comes the first Assign statement, which sets the System.Text.RegularExpressions.Regex variable rgx to new System.Text.RegularExpressions.Regex("[^0-9]"). The next Assign statement applies the Regex to the string that was entered, and the resulting series of numbers are displayed in an Alert.

    -Victoria

    0
  • Permanently deleted user

    Thanks Victoria,

    That was all the help I needed.  Awesome!

    Michael

    0
  • Robert Pincus

    I tried to open the workflow and I got an error saying that the workflow could not be loaded or was not a valid workflow.

    Any suggestions?

    Robert

    0
  • Permanently deleted user

    Robert,

    When I download the workflow and try to open it using the "Open with" method after double-clicking on the xaml file, it seems to fail.  But there is another method...I would suggest downloading the zip file, then extracting the .xaml from this zip to a known location, then open Workflow Manager and use the File-->Open from the dropdowns in Workflow Manager, then navigate to the file and open it that way.  That method worked for me.  Try again using this method and you should be able to open it.

    I hope that makes sense,

    Michael

    0
  • Permanently deleted user

    Hi Robert,

     Microsoft has changed so underlying behavior on WPF applications (which Workflow Designer is one.) If you download a workflow file, you'll need to right-click on the file, open the properties,  look for the Unblock button and click it. The file will then load in Workflow Designer.

    regards,

     

    Edmond
    0
  • Permanently deleted user
    This would be useful, but the zip file seems to be unawailable now?
    0
  • Permanently deleted user
    Sorry about that! I've fixed (https://data.latitudegeo.com/community/regex.zip) the link to Victoria's workflow.
    0

Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.