LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-28-2017, 01:39 PM   #1
snowmagician
LQ Newbie
 
Registered: Sep 2016
Posts: 26

Rep: Reputation: Disabled
Smile Regular Expression Question on the command line


It is either 10 or 11 letters, Only includes the letters a, b, c, A, B, C
Only contains number 1 and number 9 and exclamation mark

Is this correct?

Code:
--regex-only "^.{11,12}$" -%[abcABC19!]
Thanks a lot, Stack Overflow!

It is for running a python script on the command line and I want to give it the appropriate options~

Last edited by snowmagician; 12-28-2017 at 01:56 PM.
 
Old 12-28-2017, 02:25 PM   #2
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 6,230

Rep: Reputation: 713Reputation: 713Reputation: 713Reputation: 713Reputation: 713Reputation: 713Reputation: 713
Could be:
Code:
^[abcABC19!]{10,11}$
 
Old 12-28-2017, 05:22 PM   #3
snowmagician
LQ Newbie
 
Registered: Sep 2016
Posts: 26

Original Poster
Rep: Reputation: Disabled
This is my overall input at the command line

Code:
> python myscript.py --regex-only "^[abcABC19\!]{11,12}$"
It is not giving me any error message, but it is not giving me anything else either.

It did give me an error at first, which read, "Event not found" and I placed \ in front of ! and the "Event not found" error message vanished.

I notice my CPU usage is rather high which means my laptop is working on the script

Last edited by snowmagician; 12-28-2017 at 05:24 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] awk/se: splitting a multi-line input at a regular expression and rearranging sarenace Programming 9 11-27-2012 09:00 AM
Extracting all the matching patterns in each line -Regular expression AWK ksvinaykumar Linux - Newbie 7 04-10-2012 09:48 AM
[SOLVED] sed or awk help - need to remove text on each line before a regular expression kmkocot Linux - Newbie 15 10-30-2009 03:20 AM
Searching for regular expression in command line Jean Of mArc Programming 9 08-11-2008 08:01 PM
PERL:how to find a blank line in a file--regular expression littletransformer Programming 4 03-27-2008 06:55 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:18 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration