The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Regular Expression to match repeated characters jambesh Shell Programming and Scripting 4 08-22-2009 12:51 AM
Regular expression match ChaMeN Shell Programming and Scripting 2 03-24-2009 03:44 PM
Regular Expression - match 'b' that follows 'a' and is at the end of a string machinogodzilla UNIX for Dummies Questions & Answers 2 01-04-2009 04:14 PM
Exact match with regular expression jdhahbi UNIX for Dummies Questions & Answers 2 09-06-2008 12:34 PM

Reply
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 4 Weeks Ago
guruparan18 guruparan18 is offline
Registered User
  
 

Join Date: May 2008
Location: India
Posts: 37
regular expression to match repeated appearance

Hi all,

I am looking for a regex syntax to match repeated appearance. Likes,

Code:
'[[:alnum]]+[[:alnum:]]+' matches for string '65A SOME MORE AND 78B'
Now, this gets messy if I need to extract all such repeated appearance. I don't want to write [[:alnum:]] four or five times for matching repeated appearance.

Thanks in advance.

---------- Post updated at 07:56 PM ---------- Previous update was at 07:43 PM ----------

Basically, I am looking at extracting all alpha numeric from the string. Doesn't matter how many times it appears in the string.
  #2 (permalink)  
Old 4 Weeks Ago
Franklin52 Franklin52 is online now Forum Staff  
Moderator
  
 

Join Date: Feb 2007
Posts: 4,294
Can you post the input file and the desired output between code tags?
  #3 (permalink)  
Old 4 Weeks Ago
guruparan18 guruparan18 is offline
Registered User
  
 

Join Date: May 2008
Location: India
Posts: 37
Contents of test.file
Code:
68A some text here 89B some other text here.
new line here, 12A on second line 34B
some lines may have 12B and 56F and 67C and so on 23
Now, I need to read each line, compare them with regular expression '[[:alnum:]]' to fetch the string alpha numerics into a variable.
Reply

Bookmarks

Tags
regex, regexp, regular expressions

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 11:17 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0