Suppose I need to have a regex expression (using Perl regex) that, say, matches ab\q as simple text and does not interpret a as any number of a's. I know it is simple here, but I need it to work for ANY string of characters.
achava
0
Newbie Poster
Recommended Answers
Jump to PostHi achava,
Instead of matching your input indivdually, you could use this:
.+? # see explaination below
'.' The dot matches any single character, or even newline when s modifier is used.
'+' The plus or cross [ whichever you chose to call it ] then …
Jump to Postsuppose my input string is "a*b+c/\/" and I want a Perl regex expression to match it.
#!/usr/bin/perl use warnings; use strict; my $x = 'String of 8 words including numbers and letters'; my $y = 'String including characters like a*b+c/\/ plus text'; my $z = …
Jump to PostHi,
Let twists d5e5 script a little, you should get want you want. The script below uses an infinite while loop, which ends when '$' was given by the user, this will enable the user to do as many matching as possible, without running the program again and again.
Then …
All 11 Replies
wen_cai
-3
Junior Poster in Training
achava
0
Newbie Poster
wen_cai
-3
Junior Poster in Training
achava
0
Newbie Poster
2teez
43
Posting Whiz
wen_cai
-3
Junior Poster in Training
d5e5
109
Master Poster
achava
0
Newbie Poster
2teez
43
Posting Whiz
achava
0
Newbie Poster
2teez
43
Posting Whiz
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.