Search Support

Beware of phishing attacks: Mozilla will never ask you to call a number or visit a non-Mozilla website. Please ignore such requests.

Learn More

Is there a way to unstring a value that i have echoed? I need characters 8 thru 14 of a 17 character field

  • 1 svar
  • 1 har dette problem
  • 4 visninger
  • Seneste svar af cor-el

more options

I am saving a value from a screen called our policy number. The entire policy number is in this format nn-nnn-nnnnnnn-nn. I need characters 8-14 to do a search in another screen. Is there a way that I can unstring this field for only those characters? Or is there a way that I can only save characters 8-14 of the value?

All Replies (1)

more options

Use a regular expression.

javascript:(function(){var t='nn-nnn-nnnnnnn-nn',p=prompt(t,t);alert(/..-...-(.......)-../.exec(p)?RegExp.$1:'(nothing)');})();