Skip to main content
replaced http://stackoverflow.com/ with https://stackoverflow.com/
Source Link
URL Rewriter Bot
URL Rewriter Bot

ref: How do you search an array for a substring match?How do you search an array for a substring match?

The solution given here is generic unlike the solution 4556343#4556343solution 4556343#4556343, which requires a previous parse to identify a string with which to join(), that is not a component of any of the array strings.
Also, in that code /!id-[^!]*/ is more correctly, /![^!]*id-[^!]*/ to suit the question parameters:

ref: How do you search an array for a substring match?

The solution given here is generic unlike the solution 4556343#4556343, which requires a previous parse to identify a string with which to join(), that is not a component of any of the array strings.
Also, in that code /!id-[^!]*/ is more correctly, /![^!]*id-[^!]*/ to suit the question parameters:

ref: How do you search an array for a substring match?

The solution given here is generic unlike the solution 4556343#4556343, which requires a previous parse to identify a string with which to join(), that is not a component of any of the array strings.
Also, in that code /!id-[^!]*/ is more correctly, /![^!]*id-[^!]*/ to suit the question parameters:

added appropriate digression example statement terminators
Source Link
Ekim
  • 949
  • 1
  • 8
  • 9
javascript:/* a comment */  alert('visible')                                ;
javascript:// a comment ;   alert(  'not'  ) this is all comment             %0A;
javascript:// a comment %0A alert('visible but %'+'0A is%\0A a painis towrong type'')   // X     %0A
javascript:// a comment %0A alert('visible but  %\0A %'+'0A is a pain to type') // X ;

Note: Cut and paste any of the javascript: lines as an immediate mode URI (at least, at most?, in FireFox) to use first javascript: as a URI scheme or protocol and the rest as JS labels.

javascript:/* a comment */  alert('visible')
javascript:// a comment ;   alert(  'not'  ) this is all comment
javascript:// a comment %0A alert('visible but %'+'0A is a pain to type')
javascript:// a comment %0A alert('visible but  %\0A  is a pain to type') // X
javascript:/* a comment */  alert('visible')                                ;
javascript:// a comment ;   alert(  'not'  ) this is all comment             %0A;
javascript:// a comment %0A alert('visible but  %\0A  is wrong ')   // X     %0A
javascript:// a comment %0A alert('visible but %'+'0A is a pain to type')   ;

Note: Cut and paste any of the javascript: lines as an immediate mode URI (at least, at most?, in FireFox) to use first javascript: as a URI scheme or protocol and the rest as JS labels.

corrected % escape
Source Link
Ekim
  • 949
  • 1
  • 8
  • 9
javascript:/* a comment */  alert('visible')
javascript:// a comment ;   alert(  'not'  ) this is all comment
javascript:// a comment %0A alert('visible but %'+'0A is a pain to type')
javascript:// a comment %0A alert('visible but  %\0A  is a pain to type') // X
javascript:/* a comment */  alert('visible')
javascript:// a comment ;   alert(  'not'  ) this is all comment
javascript:// a comment %0A alert('visible but %\0A is a pain to type')
javascript:/* a comment */  alert('visible')
javascript:// a comment ;   alert(  'not'  ) this is all comment
javascript:// a comment %0A alert('visible but %'+'0A is a pain to type')
javascript:// a comment %0A alert('visible but  %\0A  is a pain to type') // X
corrected 'via' to 'with'
Source Link
Ekim
  • 949
  • 1
  • 8
  • 9
Loading
added digression on quoting and literal mechanisms
Source Link
Ekim
  • 949
  • 1
  • 8
  • 9
Loading
fix link cross-ref (remove final /)
Source Link
Ekim
  • 949
  • 1
  • 8
  • 9
Loading
illogically inconsistent consistently logged
Source Link
Ekim
  • 949
  • 1
  • 8
  • 9
Loading
Source Link
Ekim
  • 949
  • 1
  • 8
  • 9
Loading