Page 7 of 7
Re: A bit of regex help needed
Posted: 26 Jun 2016 05:54
by highend
I'm not sure if I understand...
When you want to capture more / less path elements, just + / - the number in {}
Regarding not capturing the last \
{ } -1 and repeat the capture group once
or just use trim($a, '\', "R");
Re: A bit of regex help needed
Posted: 30 Jun 2016 01:35
by tiago
The point is I'm having the need of specific regexes for each case described as they are all present on single documents, so a one-for-all token-wise solution won't do.
Thank you for helping, highend.
Re: A bit of regex help needed
Posted: 19 Nov 2016 08:22
by Filehero
I suspect some of my difficulties with XY regex seem to arise from unsupported expressions.
Is there any official documentation for the regex engine XY uses? Haven't found a link in the "major" threads this forum's search returns.
Thanks, FH
Re: A bit of regex help needed
Posted: 19 Nov 2016 08:24
by highend
Re: A bit of regex help needed
Posted: 21 Mar 2017 00:04
by SkyFrontier
Hello, people!
How do I process this
Code: Select all
Image of The Butterfly Effect
29.
The Butterfly Effect (2004)
7.7/10
Evan Treborn suffers blackouts during significant events of his life. As he grows up, he finds a way to remember these lost memories and a supernatural way to alter his life by reading his journal. (113 mins.)
Director: Eric Bress, J. Mackye Gruber
Stars: Ashton Kutcher, Amy Smart, Melora Walters, Elden Henson
Add to Watchlist
Image of Alice's Adventures in Wonderland
30.
Alice's Adventures in Wonderland (1972)
5.8/10
Alice (Fiona Fullerton) falls down a rabbit hole and into a magical dream world populated by surreal characters and bewildering adventures... (101 mins.)
Director: William Sterling
Stars: Fiona Fullerton, Michael Jayston, Hywel Bennett, Michael Crawford
Add to Watchlist
...reducing it to:
The Butterfly Effect (2004); Alice's Adventures in Wonderland (1972)
TIA!
Re: A bit of regex help needed
Posted: 21 Mar 2017 06:00
by bdeshi
Code: Select all
$str = <<<#YOURSTRINGHERE
#YOURSTRINGHERE;
$filter1 = regexmatches($str, "\d+\.\r?\n.*?\r?\n", "<crlf>");
$filter2 = regexreplace($filter1, "^\d+\.$(?:\r?\n)+(.*?)(?:\r?\n)+", "$1;");
text $filter2;
Re: A bit of regex help needed
Posted: 21 Mar 2017 08:31
by SkyFrontier
...never my struggle would get me there, thanks much!
Re: A bit of regex help needed
Posted: 21 Mar 2017 08:35
by bdeshi
No problem.

Re: A bit of regex help needed
Posted: 19 Apr 2017 17:32
by SkyFrontier
Is it possible for regex to capture and list all the variables present (clipboard) in a script?
Re: A bit of regex help needed
Posted: 19 Apr 2017 17:46
by highend
Code: Select all
text regexmatches(<clipboard>, "\$[a-z](\w+)?\b", <crlf>);
Re: A bit of regex help needed
Posted: 20 Apr 2017 15:48
by SkyFrontier
Perfection!
Thanks, highend!
Re: A bit of regex help needed
Posted: 27 Apr 2017 02:11
by Dustydog
I'll put in my two cents if you'll give a complete set of test data and your desired match results.
If you provide a test data sample that, when matched, covers your problem (and doesn't cover close exceptions) - we're done. Make sure to include any context that might help or hinder a correct match.
I'd rather not assemble my own definitive test data out of a series of posts, the same with your grouping requirements or whatever, but I don't mind working on it. Ofc, highend will beat me to it and likely do a better job, but still
One post, all required information and definitive (but not overly redundant) test data: This will be good for you to rigorously determine yourself anyway, regardless of help.
Clarity is good.
Hope I can help - or someone beats me to it.