Re: Regex Tool
by zentara (Archbishop) on Jun 29, 2006 at 10:34 UTC
|
My comment is to add an html link to your url so we don't have to cut'n'paste, like
< a href=http://www.geocities.com/unouse_80/app/builder.html
>appbuilder_demo</a>
Which would then appear as:
appbuilder_demo
I'm not really a human, but I play one on earth.
flash japh
| [reply] [Watch: Dir/Any] [d/l] |
|
| [reply] [Watch: Dir/Any] [d/l] |
|
| [reply] [Watch: Dir/Any] |
Re: Regex Tool
by Ieronim (Friar) on Jun 29, 2006 at 11:29 UTC
|
it is great work in JavaScript but i doubt of its usefulness :(
Can you, for example, describe step-by-step how to make a regex
qr/(ind(?:ex(?:es)?|ices))/i
in your builder? It's quite pathological, of course, but i don't see any sense of using a builder for simple regexes. | [reply] [Watch: Dir/Any] [d/l] |
|
| [reply] [Watch: Dir/Any] |
|
To be honest, i'm also doubt its usefulness for experts ;) My intent is to help anyone who feel difficult to remember the options for writing regex (i'm one of them, i refered a lot while writing the app, duh!). Also for those who are just getting their hands on writing regex (may attract them to regex, i hope!).
there's no option for qr// though. just m// and s///.
For the regex, insert string item 'ind', then create subregex with selection group, insert 'ex', create subregex, insert string item 'es' as group, with extra option 'not necessary', return to previous, insert item , return to previous, insert item, insert string 'ices', complete, return, group item. select 'i' at flag.
Yes,quite tedious. Consider this as an experiment. really need your help (and everyone else) for giving feedback. thanks.
| [reply] [Watch: Dir/Any] |
Re: Regex Tool
by planetscape (Chancellor) on Jun 30, 2006 at 16:39 UTC
|
| [reply] [Watch: Dir/Any] |
|
Depends. I've tried The Regex Coach actually when creating the regex builder. Yes, very good indeed. But for testing (it's like you try, and compile). i found it did not list out the option of what you can do/write, before you write the regex. (unless i missed something)
My intent is to guide someone, who's new with regex (and with incomplete list of regex option in his mind) and show him/her what you can do next. It just like telling 'you can do this, and that, and blablabla...' and u decide what you want to do. I have seen such tool for javascript and HTML, and informally IDE also do this (by displaying the toolbar). It's an attempt to do the same thing for regex.
But of course, it's still far from complete. Lots more to be done i.e. like testing the regex like (most) other tools do.
| [reply] [Watch: Dir/Any] |
|
| [reply] [Watch: Dir/Any] |
|
Re: Regex Tool
by eric256 (Parson) on Jun 29, 2006 at 22:18 UTC
|
Hmmm...it put \< and \> in my regex at the begging and end. Also how do you anchor ? i.e. '^' and '$'?
| [reply] [Watch: Dir/Any] |
|
Select the anchor options, will automatically put '^' or '$' or '^$'. you're allowed to put only once per regex string (that's the regex rule, isn't it?).
But there's a few bugs i.e. if you create sub regex, you can create something absurd like this ' /^item(^duhduh$) foo$/'. i'm still looking into it. sorry for that.
(i hold this quote for a while...)
| [reply] [Watch: Dir/Any] |
|
Just for your interest:
Multiple ^ or $ anchors would be legal.
The /m modifier in combination with the /s modifier would match the intended behaviour.
/m: match over multiple lines
/s: . matches everything (even newlines)
Note that you would have to insert code to match any newline either by . or by \s. See example below.
my $text = <<"END";
a sample line
item
duhduh
foo
END
$text =~ /^item.*(^duhduh$)\s*foo$/sm;
print "\$1: '$1'\n"; # prints "$1: 'duhduh'"
| [reply] [Watch: Dir/Any] [d/l] |
|
|
| [reply] [Watch: Dir/Any] |
|
|
|