F5F Stay Refreshed Software Operating Systems Another search for grep

Another search for grep

Another search for grep

Pages (2): 1 2 Next
S
Sunahh
Posting Freak
863
11-06-2020, 05:11 PM
#1
I’ve checked all possible formats, but none match 222-222-2222. It seems you’re having trouble finding it. Let me know if you’d like help adjusting the search.
S
Sunahh
11-06-2020, 05:11 PM #1

I’ve checked all possible formats, but none match 222-222-2222. It seems you’re having trouble finding it. Let me know if you’d like help adjusting the search.

E
Erykane67
Member
122
11-08-2020, 03:43 AM
#2
Study regular expressions. Using commands without thought won't help. Searching with "^[0-9]\{3\}\-[0-9]\{3\}\-[0-9]\{4\}$" shows you're looking for a pattern starting with three digits, followed by a hyphen, then three more digits, another hyphen, four digits, and ending at the line's end.
E
Erykane67
11-08-2020, 03:43 AM #2

Study regular expressions. Using commands without thought won't help. Searching with "^[0-9]\{3\}\-[0-9]\{3\}\-[0-9]\{4\}$" shows you're looking for a pattern starting with three digits, followed by a hyphen, then three more digits, another hyphen, four digits, and ending at the line's end.

K
KudlKat
Member
50
11-20-2020, 05:56 PM
#3
Use grep with Perl regex to find patterns like 123-456-7890 in file.txt
K
KudlKat
11-20-2020, 05:56 PM #3

Use grep with Perl regex to find patterns like 123-456-7890 in file.txt

M
mqrcky
Junior Member
29
11-20-2020, 09:40 PM
#4
The instruction isn't fully clear due to formatting issues. It seems you're asking about adapting a task involving Perl regular expressions within a grep context, but the original directive was incomplete. Could you clarify the specific requirements or provide a corrected version?
M
mqrcky
11-20-2020, 09:40 PM #4

The instruction isn't fully clear due to formatting issues. It seems you're asking about adapting a task involving Perl regular expressions within a grep context, but the original directive was incomplete. Could you clarify the specific requirements or provide a corrected version?

E
Enchanted_Luv
Junior Member
17
11-22-2020, 02:48 AM
#5
He requested entries with phone numbers embedded, not just direct matches. My approach will find any line containing a number in the required format, regardless of position. This makes sense since grep supports such pattern matching. If I need to restrict it further, I can add conditions like whitespace boundaries or line start/end checks.
E
Enchanted_Luv
11-22-2020, 02:48 AM #5

He requested entries with phone numbers embedded, not just direct matches. My approach will find any line containing a number in the required format, regardless of position. This makes sense since grep supports such pattern matching. If I need to restrict it further, I can add conditions like whitespace boundaries or line start/end checks.

S
snoffy
Member
119
11-22-2020, 06:45 AM
#6
The file content is displayed in a simulated format. Key details extracted include timestamps, identifiers, and structured data segments. Adjustments were made to the original text while preserving its essence.
S
snoffy
11-22-2020, 06:45 AM #6

The file content is displayed in a simulated format. Key details extracted include timestamps, identifiers, and structured data segments. Adjustments were made to the original text while preserving its essence.

I
irock13198
Junior Member
47
11-25-2020, 12:22 AM
#7
It seems the focus should be on extracting the phone number from the text. The Perl approach would involve using grep syntax to match the pattern. This method is straightforward and effective for such tasks.
I
irock13198
11-25-2020, 12:22 AM #7

It seems the focus should be on extracting the phone number from the text. The Perl approach would involve using grep syntax to match the pattern. This method is straightforward and effective for such tasks.

D
doglover4421
Member
112
11-25-2020, 09:01 AM
#8
It seems like you're discussing preferences for learning regex. Some might prioritize mastering the syntax, while others focus on practical applications. What works best really depends on the teacher's approach. You're right about the slight differences in syntax!
D
doglover4421
11-25-2020, 09:01 AM #8

It seems like you're discussing preferences for learning regex. Some might prioritize mastering the syntax, while others focus on practical applications. What works best really depends on the teacher's approach. You're right about the slight differences in syntax!

W
walee123
Senior Member
737
11-26-2020, 06:44 PM
#9
Just a note, the commands weren't tested randomly—the goal was to understand regular expressions. Since it's an online class, asking the professor late at night isn't always possible. Still, I figured it out with another student.
W
walee123
11-26-2020, 06:44 PM #9

Just a note, the commands weren't tested randomly—the goal was to understand regular expressions. Since it's an online class, asking the professor late at night isn't always possible. Still, I figured it out with another student.

Z
ZHUBOHAN
Junior Member
9
11-27-2020, 12:51 AM
#10
Calling Perl directly would likely be significantly faster in this situation.
Z
ZHUBOHAN
11-27-2020, 12:51 AM #10

Calling Perl directly would likely be significantly faster in this situation.

Pages (2): 1 2 Next