Regular expression for this?

S

stevewy

MiniTrue will do it, at least at the XP 32-bit command line (CMD.EXE) :

        PROMPT>mtr  $1.htm "onclick[^^]*>"

Thanks, John. I have downloaded the zip file of the Minitrue
executable and will try it out when I get back to the office next
week.

Thanks for the info.

Steve
 
T

Thomas 'PointedEars' Lahn

Dr said:
(e-mail address removed) posted:
I'm just trying to work out (if what I want is at all possible), a
regular expression that will search for and select (in a text editor
that supports regexps, like Notepad++) the word "onclick", then any
text at all, up to and including ">".

How "like" must it be?

MiniTrue will do it, at least at the XP 32-bit command line (CMD.EXE) :

PROMPT>mtr $1.htm "onclick[^^]*>"

The character ^ is a command-line escape, so only the second one counts;
[^] thus means to search for not nothing, which, at least in MiniTrue,
is a more potent "anything" than a mere dot is.

BTW, my tests¹ have showed that this negated empty character range is not
supported by JScript up to including version 5.7.5730 (in IE 7.0; tests with
IE 8 pending).

But it is supported since JavaScript 1.5 (Mozilla/5.0), Google V8 2.1 (maybe
earlier), Apple JavaScriptCore 530.17 (Safari 4), Opera 5.02, and KJS 4.4.3
(maybe earlier).

As an alternative, /[\x00-\xFF\u0100-\uFFFD]/ can be used, whereas
`\u0100-\uFFFD' should only be used if Unicode support had been detected.
A way to do this is

var allChars = "[\x00-\xFF[UNICODE]]"
.replace("[UNICODE]", "\uFFFD".length == 1 ? "\u0100-\uFFFD" : "");
var rx = new RegExp(allChars);


PointedEars
___________
¹ <http://PointedEars.de/es-matrix#features>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Staff online

Members online

Forum statistics

Threads
474,078
Messages
2,570,570
Members
47,204
Latest member
MalorieSte

Latest Threads

Top