| |

VerySource

 Forgot password?
 Register
Search
View: 662|Reply: 1

Ask a question about regularity! simple! There are several ways of writing

[Copy link]

1

Threads

26

Posts

14.00

Credits

Newbie

Rank: 1

Credits
14.00

 China

Post time: 2020-1-18 12:40:01
| Show all posts |Read mode
[130 | wph] | 132 | abc | b3d

How do you match this string of characters? Claim:
The characters enclosed in [] must start with, followed by several strings separated by "|"!

I don't know how to make [] this is always the beginning, the others can match! I did this:

([[] [-~] + []]) ([|] [-~] *)

Although this can match the string of characters above, but encountered this:
1a2b | [130 | wph] | 132 | abc | b3d, it will also show the matching results, but I want to keep "[]" always on top, I use the\b form-([[] [-~] + []]\b) ([|] [-~] *) doesn't work! What's going on?
Reply

Use magic Report

1

Threads

26

Posts

14.00

Credits

Newbie

Rank: 1

Credits
14.00

 China

 Author| Post time: 2020-1-24 01:18:02
| Show all posts
Haha, now it's resolved
^ ([[] [-~] + []]) ([|] [-~] *)
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list