Search Results

Search: Posts Made By: machinogodzilla
Forum: Programming 05-12-2010
2,677
Posted By machinogodzilla
RegEx in Java. \b does not react to a newline
Hello,

In Java I use this regular expression \b\w+\b as a pattern in order to find words but the boundary does not react to newlines. For example, in the following text:

hello and bye

and
...
10,069
Posted By machinogodzilla
Here is my solution based on my very limited...
Here is my solution based on my very limited knowledge. It prints "error" for every key in file2 that doesn't appear in file1.


#!/bin/bash

awk -F= '{print $1}' < file1 > keys

while read...
3,000
Posted By machinogodzilla
I should have written 'leaking' not 'eating'. ...
I should have written 'leaking' not 'eating'.

Yes, my syntax was incorrect (again) after blindly following some random tutorials (P.S. and I even know why I was following them now - I had tried...
3,000
Posted By machinogodzilla
[solved][bash] IF is eating my loops
Hi!

Could someone explain me why the below code is printing the contents of IF block 5 times instead of 0?


#!/bin/bash

VAR1="something"
VAR2="something"

for((i=0;i<10;i++))
do
...
10,069
Posted By machinogodzilla
The shell was tcsh but I used bash to run my...
The shell was tcsh but I used bash to run my scripts. With this syntax everything works perfectly. I tried to use the double parenthesis probably because they worked fine for other control...
10,069
Posted By machinogodzilla
[solved][sh] While loop -> Expression recursion level exceeded
Hi!

I wanted to use a while loop, like the one below, for checking words extracted by awk to terminate when a specific word appears. Unfortunately whenever I put my code inside the loop I get an...
2,984
Posted By machinogodzilla
Solved (well, sort of...)
Thank you for your reply, not quite what I was looking for, though. I was looking for something that was not specifically for awk, like:

\<[^\t\n\f\r ]*ab\>

But I wanted to find just parts of...
2,984
Posted By machinogodzilla
Regular Expression - match 'b' that follows 'a' and is at the end of a string
Hi,

I'm struggling with a regex that would match a 'b' that follows an 'a' and is at the end of a string of non-white characters. For example:

Line 1: aba abab b abb aab bab baa
...
86,376
Posted By machinogodzilla
I can't believe that! :eek: With the...
I can't believe that! :eek:

With the backtick it worked just fine!

I need to use the assignment with a different command, this was just an example.

Thank you both for your help!
86,376
Posted By machinogodzilla
[csh] How to capture output from a command and pass it on to a variable?
Hi there!

I'm trying to write a script that will capture output from a command and assign it to a variable.

Let's say, for example, I'd like to catch from inside the script whatever the...
Showing results 1 to 10 of 10

 
All times are GMT -4. The time now is 01:59 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy