| |

VerySource

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

MFC uses the regular class in ATL to develop regular expression programs, ask for advice!

[Copy link]

1

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-2-1 13:40:01
| Show all posts |Read mode
In MFC, use the regular class in ATL to develop regular expression programs, and use regular expressions to test normal examples. Testing in the program is not correct. Please give pointers.
Let me give two examples. Let me show you:
1. The regular expression that I want to match a date is:\d {4} -\d {2} -\d {2}, and the string I entered is 2016-12-30, but the result does not match.
2. The regular expression I want to match the Sina Break News URL is: http://sports\.sina\.com\.cn/\w/\d{4}-\d{2}-\d{2}/\d+.shtml, and I The input string is http://sports.sina.com.cn/g/2017-01-04/05012672491.shtml, if it does not match.
Reply

Use magic Report

0

Threads

36

Posts

22.00

Credits

Newbie

Rank: 1

Credits
22.00

 Singapore

Post time: 2020-3-19 13:45:01
| Show all posts
the syntax is not exactly the same as in Perl. For example, the grouping operator is (}, while in Perl it is (), and it doesn't have the {n} (match exactly n times) as in the Perl syntax
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclib/html/vclrfcatlregexp.asp

try: {\d\d\d\d}-{\d\d}-{\d\d}
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