How to extract text for username?

  • 30 January 2015
  • 6 replies
  • 2 views

Badge +4


I have a user name with "domainuser11" and need to be extract text after the ""


6 replies

Userlevel 5
Badge +12

Hello,

One way is to use a "Build String" action and then use something like the replace function inside of it:

fn-Replace(text to modify, old text to replace, replacement text)

So in your case something like - note the empty single quotes might be hard to see below as the third parameter passed in:

fn-Replace(variableThatHoldsInformationToModify, 'domain', '')

Then in the Store Results In area of the Build String put whatever variable you want the results to be stored in, which will hold the value without the domain.

Note:  I'm assuming the domain is always the same, because you didn't specify how this value was being generated..

Thanks

Badge +9

You can also use the Regular Expression action:

 

 

 

 

  • /^[^\]+\(.*)$/

     

    • ^ assert position at start of the string
    • [^\]+ match a single character not present in the list below
      • Quantifier: + Between one and unlimited times, as many times as possible, giving back as needed [greedy]
      • \ matches the character literally
    • \ matches the character literally
    • 1st Capturing group (.*)
      • .* matches any character (except newline)
        • Quantifier: * Between zero and unlimited times, as many times as possible, giving back as needed [greedy]
    • $ assert position at end of the string

 

Manfred

Badge +4

Thanks Mike M. and Manfred, both suggestions worked.  I went with the Regular Expression since we have two different domain names and formula would work in this situation.

Badge +9

Use regular expression action with operation replace text:

/^.*(/[^/]+)$/

  • ^ assert position at start of the string
  • .* matches any character (except newline)
    • Quantifier: * Between zero and unlimited times, as many times as possible, giving back as needed [greedy]
  • 1st Capturing group (/[^/]+)
    • / matches the character / literally
    • [^/]+ match a single character not present in the list below
      • Quantifier: + Between one and unlimited times, as many times as possible, giving back as needed [greedy]
      • / matches the character / literally
  • $ assert position at end of the string
Badge +2

Any parttern to extract only the comments of approver?

Badge +6

How do I clean up the approver comments to only show text value?

Reply